Moving a Textpattern Install to a New Host
I needed an easy way to move a Textpattern install from one host to another. Thanks to Rob Sable’s database manager plug-in, I was able to completely avoid mucking about in phpMyAdmin. The process, it turns out, is dead simple.
Moving a database-driven CMS from one host to another can be a daunting task for the MySQL newb — complete data loss seems too easy. But I recently moved my Textpattern-based personal domain over to Dreamhost, and it was a surprisingly straightforward process that even a technical moron like me could handle.
The Textpattern wiki offers a direct way of transporting everything with phpMyAdmin and MySQL dumps, but I figured there must be a simpler, plug-in way. And by gosh, there is.
Rob Sable, plug-in writer and Textpattern evangelist, crafted one of the best admin plug-ins available, rss_admin_db_manager. This brilliant extension enables you to perform MySQL wizardry like table repair, command execution and data archive inside the TXP backend interface. However, a non-advertised (and probably unsupported) feature is using the plug-in to move a complete install from one host to another.
So, if you don’t feel like mucking about in phpMyAdmin, follow these steps:
- Install Rob’s plug-in to your current Textpattern environment.
- Navigate to Extensions > DB Backup. Take note of the “Backup Path” and make sure the directory is completely writeable (chmod to 777 from your FTP interface). Click either “sql file” or “gzipped file.” If it worked, an entry should appear under the heading “Previous Backup Files.”
- From your FTP software (I recommend Filezilla), download an entire copy of your current site. You do not need to grab the core TXP files since you will be doing a fresh TXP install on your new server, but take special care to grab the directory with the SQL backup files.
- On your new server, install a fresh copy of Textpattern. For best results, make sure you use the same version of TXP as the install you are coming from. Also, your life will also be easier if you use the same username and password. (You do not need to keep the MySQL info the same as the old install.)
- In your new Textpattern, install rss_admin_db_manager. Do not install any other plug-ins; they will be carried over. After the plug-in is loaded, take note of “Backup Path” in the “DB Backup” tab; it may be different than your other install.
- Make sure your new “Backup Path” is writeable (chmod 777) and upload your backup SQL file to that directory.
- Navigate to Extensions > DB Backup and refresh your browser. Your backup files should appear in “Previous Backup Files.” Click “restore.” Everything from your old site will be recovered — logs, articles, presentation files, plug-ins — instantly.
That’s it. Simple, simple. Special thanks to Rob for crafting a life-saving plug-in. I’m not sure if other people have documented this process before — I just did it myself over the weekend as an experiment and it worked (so far). I have not tried this on a site with comments enabled, so I would appreciate any feedback from others who have.