I am proposing a solution for transferring a WordPress blog from one host to another.
At the moment a lot of developers use a staging server (e.g. blog.localhost) and then migrate their changes onto a “live” site. The current problem is that WordPress is very hard to migrate to a new host (e.g. blog.brianmckenna.org to briansblog.com).
Even for expert users, the WordPress database contains a lot of serialised PHP and that data includes the old host. When the data is imported into a new host, a lot of the links are out of date and can make parts of the site unusable. It’s also impossible (in most cases) to just find and replace the old host with the new host because serialised PHP includes the length of the string.
This solution would create a simple and effective user interface for migrating a WordPress installation to a new host. The user would input the new credentials (FTP and new database) and the solution would migrate everything automatically. The aim is to make it as painless as possible. I’ve included a small interface mockup to the right (which of course could be improved).
Under the hood, the solution would use XML-RPC to transfer WordPress data and copy each of the files over through FTP (including media, modified core files, themes and plugins).
There are many possible failure points:
- FTP/database permission problems
- FTP/database connectivity issues
- Time/memory/disk intensity
- Files/tables already exist and have other data in them
The solution should try to be as fail-proof as realistically possible. It should be able to decipher errors and give possible causes/solutions to the user.
At first, I would like to create the solution as a plugin. Towards the end (see the next section, Schedule) I would like to work on getting it to sufficient quality for inclusion into WordPress core.
There have been some other attempts at this problem. One example is the Serialization-fixer. These projects can work but aren’t very friendly to use and doesn’t support migrating files as well as the database.
Schedule
My University semester finishes around May 28th. My next semester starts around July 19th. That gives me over 7 weeks without assignments to work on the project (though, I’ll probably be working part-time).
May 24th
Start coding!
June 7th
Transferring WordPress data using XML-RPC should be started. Most important data to transfer would include posts and pages. At this stage, two different installs of WordPress with the plugin would be necessary.
June 21st
Transferring should be mostly finished – I should be able to enter in the MySQL credentials and core WordPress data should be synchronised using XML-RPC.
The exporting should be tested against as many different versions of Apache and PHP as I reasonably can.
June 28th
FTP migration should be started. JavaScript should initiate the migration asynchronously and report the status back to the user (via short polls or possibly Comet).
PemFTP is already included in WordPress core so there should be no additional dependencies.
Only a single WordPress installation would be necessary after this stage.
July 12th
FTP migration should be getting almost feature complete. The project should be tested against many different FTP environments and configurations.
Most reasonably possible problems should be identified.
This is the mid-way mark.
July 26th
Stability should be the focus for the past two weeks. I should try and recruit as many people as possible from the community to help test the migration feature.
Functional unit tests should be developed for things that:
- Don’t directly communicate with FTP servers
- Don’t directly communicate with databases
- Don’t directly access the filesystem
August 2nd
The user-interface should be refined by this stage. Informative error messages should be presented to the user with possible fixes or work-arounds.
I will try to get in contact with the WordPress UX/UI team so they can help me along in this area.
August 9th
Small features suggested by WordPress core should be implemented by this stage. The plugin should have been refactored via the help of WordPress core contributors. The plugin should follow all of the conventions and best practices of WordPress to allow consideration for inclusion into WordPress core.
August 16th
Only bug fixes and additional cleanup should be conducted up to this milestone. Project is now finished!
Pedro 2:57 pm on July 12, 2010 Permalink |
I need this baaad!
Chris 5:54 pm on July 17, 2010 Permalink |
Brian this is genius. Let me know if you need any help with testing. I think a lot of people including myself are very eager to see this succeed and I’d like to help.
shawn 10:24 pm on August 17, 2010 Permalink |
perfect timing. I have to move a client site from a wp-mu sub domain site to a dedicated wp site, was really dreading having to do the move. Hope this plugin makes it much easier
Mike Schinkel 5:22 am on September 1, 2010 Permalink |
This is really awesome and great to see real movement in this direction. Love how the solutions handles FTP and moving data.
OTOH, there are aspects of it that would be great for it to also address. Here are some of the things that would be great to see handled:
— Definition of server (host) information in code so that it can be persistent and version controlled and so the developer need not be burdened with typing in the information each time (or if persisted with cookies not to have the developer have to worry about loosing the information if the fields clear.)
— Support for multiple servers (hosts) and the ability to migrate in any direction and even to migrate from multiple hosts to one.
— Support for data fixups for embedded URLs and embedded paths and other arbitrary server/host specific data (such as Google Map API keys that are domain specific)
— Fully hookable so anyone who needs to extend the fixups can do do.
That said, I’ve got a solution in alpha with that functionality and there is not much overlapped in feature sets between the two solutions:
http://wordpress.stackexchange.com/questions/119/#182
It would be great it we would someone merge the two solutions moving forward or at least some up with a way that users are not presented with a choice of either/or:
-Mike
Brian 6:20 pm on September 30, 2010 Permalink |
If you need some testers let me know. I could really use this tool.
Josh 4:14 am on October 4, 2010 Permalink |
U safe me! where can I donate? u got FB?
Karen 8:14 pm on October 15, 2010 Permalink |
Genius indeed. Pleeeeease tell me you have this working!
Tom 9:36 pm on February 8, 2011 Permalink |
Is this still in development ?
From perusing the code it looks like exactly what I want, but I haven’t been able to complete a sucessful migration with it yet.
I’ve had three issues so far:
1 – The code looks for stuff in ‘plugins/wp-migration’, but the zip file from http://wordpress.org/extend/plugins/automatic-migration puts stuff in ‘plugins/automatic-migration’. I fixed this by renaming the directory to match the code. I think the real fix would be for you to send wordpress.org a new zip file.
2 – It took me a while to realize I had my site protected with a .htaccess file. All the plugin told me was something like “can’t access site”, so better error messages would be nice.
3 – It looks like it copies all the files over OK and puts a lot of stuff in the new database, but the page where I launched it from sits there with:
…
Loading…
seemingly forever. I wonder if it’s still running or what ? Better progress indication would be nice.
Ian Douglas 3:09 am on July 12, 2011 Permalink |
Can I ask, what happened with this project? Was it completed, and if so where can I find the plugin, so I can use it? Thanks
Snaky 2:05 pm on August 11, 2011 Permalink |
What is the status on this?
John 7:28 pm on April 5, 2012 Permalink |
Awesome idea