Making a fully functional duplicate backup copy of WordPress site in another folder on web host
You may want to have a duplicate of your site as a development area so that you can demonstrate a new set up or to make changes without it being live to the public, but so that you can show a client who has the url. Then when the site is ready you want to be able to quickly make it live to avoid a lack of availability during the change over.
This is my shorthand checklist version of instructions to remind myself in future. If you want a fuller version, please contact me. This method took about half an hour to do for a site with around 100 posts and it copied across all of the styling and widgets and users.
- Copy all files to a folder on your computer – called it wpfiles
- Find the database that relates to that site (look in the wp-config file if not sure) – make a backup of that (button in the control panel) and save it in a folder on your computer – called it mysql
- Create a new database in the control panel
- Import the data from backup database on your computer (in phpMyAdmin)
- Create a new folder in your public_html – called it sitebackup
- Copy all files from computer wpfiles folder into sitebackup folder (via FTP)
- Edit wp-config file in sitebackup folder put in the new database name and user (the same) and the new password – and save.
- Use the search and replace toll from Interconnect/it search for yourdomain.uk/oldfolder and replace with yourdomain.uk/sitebackup (in my case it was actually find subdomain.yourdomain.uk/oldfolder and replace with yourdomain.uk/sitebackup). Be very cautious if this is your first time using this tool.
- Log into the site admin in the new location (yourdomain.uk/sitebackup/wp-admin) and go to Settings-permalinks and save to fix any issue with links.
- Check everything is working as you expect – look at links to full text of posts, links to menu items. Are widgets all there? Are images all showing? Are videos showing?
To avoid people accidentally finding your backup by guessing the folder, maybe instead of sitebackup call the folder a random lot of letters and numbers?