Migrating domain

wordpress

#1

I used 1 click wordpress install on a domain as a test site site.blah.com

I just registered a new URL to host the site blah2.com

I like 1 click installs as the upgrades are easier and would prefer to keep it that way, but I’ve already spent quite a bit of time setting up the current test site.

I’ve tried mirroring for a bit, but eventually I end up at site.blah.com.

What I’m wondering, if

1)I were to backup my site and database.
2)Do a 1 click install of wordpress on blah2.com
3)update the table prefix in my database backup and essentially overwrite the new database content
4)ftp the rest of the wordpress content over

Would Dreamhost still treat it like a 1 click install and be able to run updates?


#2

That would indeed work :slight_smile: I would also remember to remove the 1-click install for site.blah.com (you can just de-list it) so our robot doesn’t try to upgrade THAT too.


#3

So after a few hours I think I have things sorted out. We’ll see how well autoupdating works with the next push.

These aren’t quite step by step, but should be helpful for anyone else who’s interested.

For reference we are moving a wordpress install from old.com to new.com

1)Go to Manage Domains and setup to fully host new.com
2)Once that is ready use 1 click install wordpress on new.com and complete the installation process. The actual username you setup doesn’t matter here.
3)login to old.com
4)Find mysqpl prefix
wp_old_
5)Run database backup. I called it migrate.sql
6)From the Dreamhost panel go to phpMyAdmin and find out what the new mysql prefix is. You will also want to write down the new mysql domain, address, and password
wp_new_

7)SSH into your old.com account.
8)Go to the directory where you saved migrate.sql
9)vim om/migrate.sql //we’re going to change your old database prefix in the backup file to the new one
10) update Host: to new mysql host name
11) update database: to new database name
12) Hit escape then type //I’m paranoid so I wanted to confirm each change. If you leave off the c at the end it will just update all of them
:%s/wp_old_/wp_new_/gc
:wq
13) Select your migrate.sql file in phpmyadmin for new.com and import your updated database backup to new.com
14) Browse over to wp_new_options table. Find the siteurl. You need to update that to new.com
15) SSH back to old.com
16) Find wp-config.php
17) Update the database data with the new database information. If you want copy and paste the values from the new.com/wp-config.php
18) Make sure you update the prefix here as well
19) Go back to old.com and check the site. Everything should be working. But you’re not done yet. We only migrated the database
20) Since I used the same user to host the domain I was able to use rsync to copy the directory contents over. This is much faster than using FTP. I would
recommend that you backup first
rsync -av --delete old/ new/
21) You should be able to go to new.com and find your site migrated there.
22) You still need to update your internal links. I used the Velvet Blues Update URL plugin to do that easily. Just make sure you had written down your old URL from the settings page previously.


#4

i’ve found this script is brilliant for wordpress moves: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

http://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs


#5

@veeber:
As a forum is meant to be a repository of knowledge, I applaud you for providing such a detailed account of how you accomplished this. All too often, people don’t search forums, and when they do, all they find are people who just say “Fixed it, thanks” (if even that), leading to greater and greater levels of frustration. I’m sure others will find this useful in the future. Thank you.

@bronw3n:
Thank you for adding additional resources. They are useful and appreciated.