0
I have a Wordpress website published on a remote PC. I want to back it up it totally on my local CentOS PC, including posts, images, videos, etc.
Here is what I have done:
- Download and install Wordpress on my local PC.
Back up the MySQL database on the remote PC using this command:
mysqldump --user=root --password=XXXXXX --opt wordpress > wordpressBK.sql
Restore the MySQL database on my local PC using this command
mysql --user=root --password=XXXXXXX wordpress < /home/mysqlDB/wordpressBK.sql
Now when I open my browser and go to http://localhost
, the backup seems successful, but the URLs of topics and images in Wordpress still go to my remote Wordpress address (e.g. http://www.AAABBBCCC.com/?p=1365
)
What I want is to copy everything to my local PC. How can I manually complete this backup?
If possible, I would prefer not to install plugins.
thank to the reply , after I change site URL in mysql DB ,it works here is what statement I execute
UPDATE wp_options SET option_value = replace(option_value, 'http://www.XXXXXXXX.com', 'http://192.168.3.116') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.XXXXXXXX.com','http://192.168.3.116');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.XXXXXXXX.com', 'http://192.168.3.116');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.XXXXXXXX.com','http://192.168.3.116');
That is because the configuration of the Wordpress install is pointing to the remote host. I'm not sure what you'd have to do in order to have a functional local backup. Typically, you'd go into the wpconfig file and the database (usually via the admin page, but also doable through direct db edits) and change the url and local file paths for Wordpress. But the issue is that you're confusing two things: creating a working copy, and backing up. A backup is not typically intended to be functional, but only exists in order to be restored to the original location. Decide what you really need. – music2myear – 2019-02-20T17:57:30.590