My application for GSoC 2010

Problem

Currently, if you want to move your WordPress install to a new host and keep the same domain, you only need to move all the files (WordPress Core, Themes, and Plugins), and then export/import the database. It’s pretty straight forward, but still more complex than many users are capable of.

However, if you want to change the domain (even without moving to a new host) you have to export the database, do some search and replace on the .sql file, and then re-import the updated database. Even then, if the new domain has a different number of characters in it than the old one did, you can run against problems if any of the places you replaced the name happened to be inside a serialized array (almost all the options, including things like widget settings, text widget text, etc).

The goal of this project would be to make a these kinds of transitions simple and smooth. If only the domain is changing, then when the user updates the WordPress URL we would update internal links in their posts, settings, image urls, etc. If they are moving to a new host, allowing them to install WordPress at their new host and enter their credentials for their old host (WordPress admin credentials as well as FTP credentials) and WordPress would simply import everything (posts, settings, uploads, theme, plugins, etc).

There are 3 possible cases

  1. Change the domain on the same host.
  2. Move to a different host.
  3. Change the domain and move to a different host.

Change the domain on the same host

This basically requires finding every occurrence of the old domain name in the database and change it to new one. We may face problems when the data is stored in a serialized array, so I’m first going to unserilaze the data from each row, make the necessary changes and the then put it back in the database.

Move to a different host

I will ask the user to install WordPress on his new host, collect the ftp details from the user. I will then use these ftp details to fetch the details about the database and drop all the tables. I will then dump the database on the old host, transfer it to the new host via ftp and then import it to the new database and then I will copy wp-content directory via ftp.

Change the domain and move to a different host

I will first move the blog to the new host as described in case 2 and then change the domain name as described in case 1

Plugin, theme, or core: I would like to develop it as a plugin, as most of the users might not need this option.

9 Replies to “My application for GSoC 2010”

  1. I’ll echo a good luck with the App, Satish. 🙂 This has been a problem for quite sometime. I’ve dealt with it by always doing a fresh WP install on the new domain and opening WP’s OPML export file in a text editor and doing a global search and replace  for the domain name. It’s worked well but I agree it’s more technical then it needs to be.
    What we need to do is either make use of relative links (EX: /wp-content/uploads/2009/11/Swift-logo.png  instead of http://swiftthemes.com/blog/wp-content/uploads/2009/11/Swift-logo.png  ) in for images in posts and self linking or use a dynamic replacement with php like some other systems. vBulletin uses dynamic text replacement.
    Again good luck. 🙂

    1. Thank you. I will try to make the process as simple as possible with this plugin. I’m also planning to prose the use short code for the uploads directory, so that content will be domain independent.

      I have to run some tests to see how much additional load it’s going to put on the server before I make the proposal.

  2. Good luck with your application, Satish.  I just started using your theme a couple days ago and I’m really impressed.

Leave a Reply

Your email address will not be published. Required fields are marked *