November 25, 2019 at 10:10 pm #143AmineGuest
I have a backup taken with “wp export” and I have the tar.gz of the site public_html folder. How to use those on a brand new server to restore an identical website. ThanksNovember 26, 2019 at 11:54 am #145
Hey Amine, welcome to WorP’Dev. I’m Nabil, The WordPress Developer. I will be glad to assist you.
Since you don’t have a database backup, you won’t be able to create an exact copy of the previous website. The database contains important data such as website, plugin and theme options, posts metadata, etc.
Here is how I would do it:
STEP 1 – Prepare a WordPress Installation
- Install WordPress normally on the new server.
- Extract the uploads folder (
.../wp-content/uploads/) from the tar.gz file and copy its contents into the new website’s uploads folder.
- Do the same with the
- Go to your dashboard and enable the theme you want to use and the plugins you still want to use. Feel free to delete the ones you no longer want.
STEP 2 – Prepare the WXR File
- Open (a copy of) the WXR file and do a search and replace, you need to replace the old website URL with the new one. We need to do that so that the WordPress Importer can find the attachments and can import them.
- Once you do the search and replace, look for an occurrence of the
attachment_urlXML element which contains the new URL and test the URL in the browser, it should show the image.
- Test another few (2 or 3) URLs just to make sure they are correct then save the new copy of the WXR file.
STEP 3 – Import with the WordPress Importer
- In your dashboard, go to “Tools > Import”.
- Under “WordPress,” if you haven’t already installed the importer, click “Install Now.”
- Click the “Run Importer”, provide the WXR file then click “Upload file and import.”
Give this a try and let me know if you need further assistance.November 26, 2019 at 6:09 pm #192
Subscriptions were not working earlier today, so you may have missed my previous reply.November 26, 2019 at 6:20 pm #194AmineGuest
Thank you. Actually I have a db backup and the website url will remain the sameNovember 26, 2019 at 10:06 pm #196
That makes things easier.
Step #1 – Restore Files
The first thing you need to do is to extract the tar.gz backup into the new website root folder. When you do that and access you website, you should see the error message “Error establishing a database connection”, don’t worry about that message, it will go away after Step 3.
Step #2 – Restore Database
Create a database if you don’t already have one, then import the SQL file into it. The easiest way to do the import is to use phpMyAdmin, it’s most probably already available if you have cPanel.
Step #3 – Tell the WordPress Site about the Database
wp-config.phpfile and update the database connection information.
This should do the trick. Let me know if you need more help.