skip to Main Content

I have a woocommerce website installed and work normally , I want to change the theme without make changes on the website so all still ( products , pages, …etc) .
I want to copy the same website into another domain to do changes without stop my first website .

this what i have do :
1- copy all files from the old to new website.
2- import database frm the old .
3- past into the new domain all files
4- import the tables of the old database to the new database
5- change the wp-config to work with the new database
6- change the domain into table : wp_options
and i launch the new domain : the first page is ok without errors
but when i enter to preview product i have error that page dosen’t exist , and all other pages the same error . can any one help me ??? any ideas ?

2

Answers


  1. When moving a WordPress site a few things to make it easier.

    Manually, zip up uploads/plugins/theme or if you have some crazy thing going on wp-content. Generally, nothing else needs to be moved. (this excludes things like robots.txt etc you may have to move)

    After importing the DB you need to run a search and replace to swap out the domain. It is used in more places than you think.

    Go to settings and re-save permalinks twice. – This fixes most issues with pages not loading/404.

    There are plugins out there that make this easier.

    Updraft – Don’t need the paid version. Can setup new site then add files and import them.

    All in One WP Migration – Haven’t seen anything this doesn’t move but can be slow and harder with large sites.

    Login or Signup to reply.
  2. Plugins like All in One WP Migration or Duplicator can be helpful, but from time to time they may fail.

    With AIOWM you must create a backup and a blank WP installation, install the plugin in this blank installation and import the backup. Beware that many features are paid.

    With Duplicator you create a backup and an installer that you’ve to upload (via FTP) to the new host and there execute the installer.php script to recover the backup.

    Both of them take care of the search&replace needs.

    If you want to go manual, you have to copy all files via ftp, or if you’ve a Cpanel or similar you can upload a Zip file and then extract it via the panel (I guess you don’t have the ssh access to the server).

    Than you’ve to create a database dump via PhpMyAdmin and restore it in the new server, thank you’ve to change two option in the database: the site url, and the wordpress address url.

    That should let you login to the website backend, but BEWARE you’ve to do the search and replace on your database.

    To do so, easyly, you can use Better Search & Replace plugin (https://it.wordpress.org/plugins/better-search-replace/).

    Guessing that http://old_domain.com is your old domain and https://new_domain.com is the new one, usually I go this way on S&R:
    – Search for “old_domain.com” and replace with “new_domain.com”
    – Search for “http://new_domain.com” and replace with “https://new_domain.com” if you have an active SSL certificate

    Than go to Settings -> Permalink and save twice.

    Everything should be fine now 🙂

    Remember to clean every cache if you’ve one active.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search