WordPress WooCommerce Staging Site Database Sync - mysql

I manage a WordPress WooCommerce site which has a couple mishaps in the recent past. There is no staging environment setup which would have prevented the mishaps and is not trying to set one up.
I have researched many WordPress DB Sync plugins, however, not many states they work well with WooCommerce. The issue is on my side, the product team can update add/remove products, categories, blog posts, etc. at any given time, they have no set time-frame window which updates the site.
I need a way that I can sync menu structures, products, and all, blog posts, etc. with the production environment. I need to sync, because while the product team is working new orders come in and comments are posted, etc.
Is there any easy way to set up a staging site that will accomplish this?
Daily, I work with MSSQL and write a lot of SQL, so I thought I could write a sync script for moving/syncing data to production, however, the command I needed "MERGE" is not available in MySQL. Or, is there a way WordPress can run on MSSQL?
Any ideas?

My suggestion, you can use default WooCommerce Import and Export available on the Product page on the top side.
It is the best option to save all database in Raw format and easily restore as per your need.

Related

MySQL data transfer/update to another database

I have a forum which is here or http://neue.st/index.php
and I want to transfer the data from that forum to a new forum in a different directory http://neue.st/forums
I also only want to have select pieces of data to be transfered such as users, posts, topics, forums but not things like themes & mods
I am doing this because I kinda of screwed up the data for mods & themes for the original forum & have no idea how to reverse it because I forgot to do the backuping
Is there anyway to do this with phpmyadmin
A good tool to use... but not absolutely necessary is PMA (phpMyAdmin). You should log in, click on the database you want to export data from and then click the export button.
You can see there is a "custom" choice, upon selecting that you will be presented with more options including the ability to choose which tables you need to export.
After that, head on over to your other database and import the SQL file that was generated/downloaded and happy days.
you can use SQLYog community edition, it is easy to select what ever data you want to export.
If you download the Support toolkit from phpBB you are able to 'clean' the database of all non standard tables and rows (i.e. things added by MODs), leaving you with a clean database.
For themes that you no longer need, you can delete and uninstall these via your Admin control panel before removing them from your server.
If you just use 'selected' parts of your database then chances are it won't work properly because there are so many relationships between the different tables.

Merging two WordPress Post/Comments tables in MySQL phpMyAdmin

I know the "merge tables" question has already been asked in a variety of ways, but I can't seem to find an answer to my specific question.
Here's my deal: I've been designing a WordPress site for an organization for four weeks. When I began designing I took an export of the database and imported into my local development site. In the meantime, this organization has naturally continued to post things and receive/approve comments on their live site. On the local side, I have also created posts, edited pages, changed widgets, etc during development. So now that we're ready to launch the new site, I need to figure out how to merge these last four weeks of database changes from both the live site and the local site without losing anything on either side. How is this done?
If there have been inserts to both databases, then unfortunately there isn't a good way to merge. If your database contains the latest edits for the Post IDs that are shared then you can export them to XML and then import them into the other site.
This is done with the WordPress Importer plugin which can also be installed by visiting /wp-admin/import.php, the export can be done on /wp-admin/export.php. You can also remove any conflicts from the XML file manually, but make sure that you keep it well-formed.

Magento: Sync database between staging and production

I have two instances of Magento, a production site and a staging site, both have there own codebase and mysql databases.
We have been making some changes to the staging site, specifically we have installed the aheadworks - payments and subscriptions module which has been configured.
We need to sync all the products from the production site to the staging site, then we will need to make our changes to the products so they are configured to work with the aheadworks - payments and subscriptions module and finally upload everything back to the production site without wiping out any new customers/orders that have been added to the production site while we have been making our changes.
Could anyone please explain how we could achieve this ?
Thanks
Steven
I suggest first copying the entire live database into your staging environment. That way, you have the most recent (live) data to work with on staging. After that, do some testing of the newly installed module on staging. Implement any template and code changes needed and test if the required features are working (for one product). Once everything works as expected, install the module on live, configure it there and start using it there.
So try to do most of the database / admin changes on live only, and use the staging environment just for testing if the module does what you need. That way, you avoid having to do complicated synchronisation of the database as well as having to do the same thing twice. Synching the databases can easily lead to problems like duplicate order IDs, and it's a lot of meticulous work which I would try to avoid. After all the products are changed on live, you could copy over the whole database to staging again, to sync afterwards. That's a lot less risky and meticulous. Hope this helps.

Add joint primary key to wordpress posts table

I am working out how to synchronize wordpress installations where both can be updated simultaneously, and both can work offline, then come online to sync.
I think the easiest way to sync posts between sites, is to include the site id in the primary key of the posts. Therefore, any post is identified by an incremental id and the id of the server location it was created from.
Is this possible to achieve with a plugin?
What dangers lie ahead if I pursue this path?
Is there a better, alternative way to achieve what I am trying to achieve?
It is possible in several ways:
- Write a stored procedure inside the first Wordpress installation's php files, that inserts the content into the other database when something is written to it. This one probably won't work offline.
- Write a function that compares the two databases at a schedule time using a simple sql query and creates a diff log. Then copies over the difference to the other database.
It depends why you need to do this, but if this works, I would recommend this solution:
- Keep one wordpress installation. Maintain one database, and connect to it from the other website to load the content. You can create your own SQL connection to it and load whatever content you need.
- Keep one wordpress installation, and use it's RSS feed to read the content and display it in whichever second website you need to do it in.
I can't imagine how a plugin would be of much help, especially keeping the databases in sync offline too. In my experience, its usually better to write your custom php scripts, rather than use a plugin so you can have a more direct control over the functionality.
Hope this helps.

Massive Wordpress database migration

This is a doozy of a question...
I am developing a new wordpress website to replace my client's massively sized blog (tens of thousands of pages). Their existing blog is built on a custom PERL blogging platform from 1992...so as you can imagine, it needs updating.
My job is to find the BEST possible way to migrate all of their existing data into a format that wordpress can understand.
The new theme is very advanced, and this job is very advanced as well. After searching for specialists, I can't seem to find anyone who specialized in this field. What would you do in this situation? Thanks!
I've done this before, it's not that hard. I approached it as a wordpress plugin. First get the plugin to connect to the old database and get it to pull the information you need. Then you can use native wordpress function to insert new users, posts, comments, etc.
I did it line by line, which isn't the most efficient approach, but it is the easiest. I used an AJAX front-end to display the conversion status and repeatedly call the converter back-end, as the actual migration took up to several hours.
If the site can't be shut down for that long while you migrate the database, you could either look at doing a proper bulk export/import, or lock old topics and migrate those over first.
My converter was for an old PHP nuke site, and due to the fact that we were using WP-United, I didn't have to worry too much about user credentials and comments. However, the code might help you get started: http://www.wp-united.com/releases/php-nuke-converter
I have done a couple of these Wordpress migrations. The theme you're using in Wordpress is really not that big a deal, most likely. Themes in Wordpress don't ordinarily impact the database structure.
The Wordpress side is easy, it's in MySQL in most cases. The place to start for you would be to determine how the data in the PERL blog is stored. If it's a custom blog solution, there probably isn't a script you can find to do the migration. Hopefully, it's in a data form that will allow you to do a data dump in a format MySQL will allow you to import using something like phpMyAdmin (a popular GUI for MySQL). At that point, you can create a MySQL statement to match up the relevant fields in your old data with those in MySQL. If you're not comfortable doing it and want an expert, the thing to do is find out how the PERL blog stores it's data and find someone who is familiar with both that format and MySQL.