A while ago, I had to make a backup of a website that was running an incredibly old version of WordPress (3.3-RC3). To top things off, I only had FTP access – no cPanel, no phpMyAdmin, no SSH.
So I spun some scripts together to quickly export the files and database from the website. It turned out to be much more convenient than exporting any other way!
Now whenever I just need a quick dump of a WP install, I often do it this way. It’s quick and handy when you’re just migrating a site to a new domain. Or when the site is about to be replaced by a new one and you just need a snapshot.
tl;dr Quick Instructions
The recipe is simple: grab the `php` file in the zip below, upload it to the root of your site and go to the URL (http://yourwebsite.com/export-me.php). Remember to delete it when you’re done.
How it works
Take the file below and upload it to the root of your website using FTP (or cPanel file manager, etc.). Make sure it is in the same folder as ‘wp-config.php’.
Then, in your browser go to the URL of your website and append ‘export-me.php’. So it will become http://yourwebsite.com/export-me.php.
You will get a simple (long live the 90s!) form with only a dropdown with the various options: download everything (database & files), database only, all files, or just themes, plugins or uploads. Check the box below it if you want to go straight ahead and download the export file. Click ‘Go’ and you should be presented with the download link on the next page.
Whether you ticked the check box or not, the export file will always be stored on your server. So when you’ve downloaded the file, remember to delete it afterwards in your FTP.
And, most importantly, remember to delete the export PHP script! You don’t want strangers to come in and export your site for you.
That’s all there is to it. A full snapshot of a site in (possibly) less than 30 seconds.
Ps. extra tip: if you want to install the site on your local host, I always use the Search and Replace tool by InterconnectIT to fix up my path and domain in the db!