Re installing and upgrading site. Migrating Data

mccpie01

New Member
Hello, I am redesigning a site and have created a Blank staging copy with the New Themes and the rest of the environment.
I want to export/Import the products from the woo commerce to the staging copy.
I have tried a few commercial Export-Import tools but I like a way to do this in a Bash script.
So I like to export the Product, The SEO meta, alidropship config and what other table do I need?

Here is what I found so far:
Product export
mysqldump --login-path=login_path --single-transaction --no-create-info --skip-opt --databases db --tables posts --where "post_type='product'" > products.sql
Metas
var=$(mysql --login-path=login_path --single-transaction db -N -e "SELECT ID FROM posts where post_type = 'product') function join_by { local IFS="$1"; shift; echo "$*"; }!1 ids=join_by , $var mysqldump --login-path=login_path --single-transaction --no-create-info --skip-opt --databases db --tables postmeta --where "post_id in ($ids)" > meta.sql
 
which plugin do you use to clone a site? I tried ns cloner but all menus, widgets, and appearance settings have to be reconfigured manually.
 

the_lyall

Active Member
which plugin do you use to clone a site? I tried ns cloner but all menus, widgets, and appearance settings have to be reconfigured manually.
I've used Duplicator several times (free version) it struggles on some sites (4GB+) but generally it works well. It creates an exact clone so you need to update any hard-coded links to use the new domain etc.

It also copies all user data, orders, products etc. so if it's for a new site you need to remember to delete everything. Also, if cloning a site to use it as a test version (as I've done for a few) I install WP Mail Log and WP Mail SMTP. You can use the setting in WP Mail SMTP to disable any emails being sent (so the users don't get emails from testing) but you can still use WP Mail Log to see the emails that have been generated without actually sending them. I use WP Mail Log on all sites so I can see/check what emails are being sent to customers.
 
Top