How to change domain with existing ee setup?


#1

Hi,

First of all, great work! I really like the easyengine and optimization steps.

I setup a single site Nginx-WordPress-W3 on a Digital Ocean droplet. Now I want to link the WordPress installation to another domain. What is the best way to change the domain of the installation?


Example.com does not exist in database
Wordpress site - ee site info says html basic
#2

I assume you created example.com and now you want to chnage the example.com to mydomain.com

In this case:

cp -v /etc/nginx/sites-available/example.com /etc/nginx/sites-available/mydomain.com  
vim /etc/nginx/sites-available/mydomain.com

replace example.com with mydomain.com

cp -av /var/www/example.com/htdocs /var/www/example.com/wp-config.php /var/www/mydomain.com  
ee site enable mydomain.com

Now lets delete example.com if you don’t needed anymore
ee site delete example.com --all

Please let me know if you are looking something else


Changing domain name from IP address (while initial setup) to new domain name (example.com)
#3

Thanks!

This works, I only had to create a the folder: "var/www/mydomain.com". Is this correct?

And when I delete example.com, do I also have to drop the database? Or is this the same database as for the new mydomoain.com?


#4

ee site delete command reads database name from wp-config.php file. So even if database name is not changed, delete command can drop database.

For more details - https://rtcamp.com/easyengine/docs/commands/site/delete/


#5

Hey there,

Thank you for your great support. Actually, I’ve done everything you mentioned above but cannot solve the problems yet. It still showing ‘welcome to nginx server’.

wordpress : Installed wordpress 3.9.1 multisite + w3 + nginx helper.
Have just 1 site. Didn’t activate sunrise yet.

  1. I’ve done DNS setting and domain is correctly pointing my droplet’s IP address. (digitalocean)
  2. I have 10 post + several pages in DB and trying to connect my new domain with this contents.
  3. I did everything correctly what Mitesh kindly mentioned above.
  4. When I typed ‘vim /etc/nginx/sites-available/mydomain.com’ this command on ssh there are some lines that pointing my old domains then I’ve changed those old domain to my new domain.
  5. Followed every steps + add some codes in wp-config.php

define(‘WP_HOME’,‘http://example.com’);
define(‘WP_SITEURL’,‘http://example.com’);

  1. And add some codes on functions.php in theme folder

update_option(‘siteurl’,‘http://example.com’);
update_option(‘home’,‘http://example.com’);

  1. Result?

COULD YOU PLEASE HELP? My customers are complaining like hell. PLEASE.


Best way for test/shadow Wordpress install
#6

@Joshua

It seems like you are facing lots of issues and I hope most of them as been already resolved.

Regarding the domain redirection issue you are facing, I think the domain mapping is not correctly done. Kindly cross check it.


#7

Dear @Mitesh

Thank you very much for your input.
Well, Not a chance yet, still receiving same result. ‘welcome to nginx’. Actually I have no ideas how to reconfigure domain mapping. Could you please show me what is the best solution?

Please advice,

Josh.


#8

ee site delete example.com --all

I didn’t perform this command yet. Should I do that? Everything has been copied to new folder named with new site name.


#9
Actually I have no ideas how to reconfigure domain mapping. Could you please show me what is the best solution?

Domain mapping guide: https://rtcamp.com/wordpress-nginx/tutorials/multisite/domain-mappinng/

ee site delete example.com –all

I didn’t perform this command yet. Should I do that? Everything has been copied to new folder named with new site name.

Did you import example.com database to new site?
If yes and you don’t need example.com files/database then you can delete that using

ee site delete example.com --all command


#10

I see that this topic is quite old, but it is the most relevant to the issue I’m having.

I spun up a new WordPress website using Easy Engine. The new website was set up using one domain (EXAMPLE.NET), for a client who has his live website up and running on EXAMPLE.COM

As far as the domains go, only the TLDs are different.

Structurally, the new website will be running WordPress MU and the old website is running on the standard version. To avoid any potential complications, I’ve manually imported all the content (posts, pages & media). I’m ready to modify the DNS of EXAMPLE.COM to point it to the new server’s IP Address, but I need to make sure my new “Easy Engine” server is ready.

So I have a couple questions, regarding these steps:

  1. Are these steps still accurate for the most recent version of Easy Engine? If not, please post the “newer/updated” steps.
  2. I don’t see any reference to duplicating the website’s database in these steps. Do these steps take care of duplicating the database? If not, what is the best process to do that?

#11

I find it hard to believe a system as robust as Easy Engine, doesn’t have a built-in command to accomplish Domain Name Changes.


#12

It looks like the URL may have changed to:

https://rtcamp.com/easyengine/docs/commands/site/ee-site-delete/

So, in this instance, wouldn’t the better command be:

ee site delete example.com --files

…which would leave the Database intact, for use by the newly created mydomain.com


#13

Hello, I builded an client on digitalocean using ee site create example.com --wpfc with the mysql db on an other machine. Now I would like to duplicate my client in order to have two clients with the same configuration but when i follow this istructions the new client give me the “Welcome to nginx!” page. How can i fix it?

Best regards


#14

Hi I followed the above steps But got stuck at ee site enable mydomain.com I get error message site mydomain.com does not exist where as if i do cd /var/www/mydomain.com i can see all my files moved from example.com


#15

You forgot to copy the new entry in sites-available to sites-enabled.

That fixed the ‘welcome to nginx’ issue for me.


#16

yea this does not work. Making a copy of sites-available to sites-enabled does nothing… Any ideas?


#17
ee site create newsite.com --wp
cd /var/www/newsite.com/htdocs
rsync -vaz /var/www/oldsite.com/htdocs/ .
mysqldump oldsite_com > oldsite_com.sql
mysql newsite_com < oldsite_com.sql
wp option set home http://newsite.com
wp option set site_url http://newsite.com
ee site delete oldsite.com

That’s it, basically.

Of course you have to make sure both blogs use same database prefix, or make adjust on wp-config.php for the new site.


Change wordpress domain of existing Easy engine installation
#18

If only the sitename should be changed and the server should not be changed, you can do it without moving htdocs and mysql. You have just to rename webroot-dir and nginx-config-file and then update the ee-database. I use a simple shellscript for that from time to time:

If someone likes it…here is the script on pastebin:

http://pastebin.com/HE8g7ddm


Ee site change from dev.domain.com to domain.com
#19

great job, it works but it redirect the url to old site on multisite.


#20

how to use that script ? thank you :smiley: (solved)