Migrating Wordpress multisite to single sites - php

I am moving 11 sites that are currently in a Multisite configuration in an internal network, and would like to migrate them to WP Engine as single individual sites.
I would like to use phpmyadmin to export the data site by site. I am using HeidiSQL to connect to the database and exporting as sql. I will need to manipulate the data, turning it from a multisite to a single install.
What specifically should I be modifying?
-removing site id (i.e. wp_17 to wp_)
-what else?

I would test the plugins first before I do the migration, I know 11 sites will take too much time.
although keep in mind that 99% of the popular plugins has been tested to a newer vision of WP.
Don't forget to change the Wp_config from multi-sites to individual.

Related

How to maintain databases for local wordpress development when site is live?

I have just started with WordPress development and I ran into a pretty big roadblock. I used MAMP to develop the site locally, and chose WPEngine as my host.
I created a theme that utilized plugins like Custom Post Types UI, and Advanced Custom Forms. For this reason, I had to upload my local MySQL database to the host to keep all the data those plugins relied on.
This is all great and dandy, but there must be a better way than managing a local MySQL database, adding data to it, and then exporting it to later import it in the production database. Is there something I'm missing with this workflow?
EDIT: I also have to perform a find & replace on the URLs each time I migrate the DB's, thats a huge pain

Wordpress Multisite MULTI DATABASE

I have recently discovered the multisite functionality of the wordpress core. really exciting! After digging around some more, I noticed that the database simply replicates 9 tables each time we create a new subdomain; but keeps them all in the same database.
The project I am in the planning stages for has a high amount of data information to be stored. The information that would be stored would be proprietary for each company that uses the site.
My question is this. How would I go about getting the entire database to replicate vs getting just a few tables to replicate? Basically, I am looking to create exact copies of the site over and over and over, but each site would have its own database. eventually, each copy of the site would be created once a customer has paid to use the service.
I have seen shardb and hyperdb, but they actually just add databases to store tables from multiple subdomains (at least thats how i interpretted it) to increase site speed.
Im not concerned about site speed as much as I am security and redundency.
Any ideas?
One of the features of MultiSite is that all the WP instances use a single WP installation, and a single database, just with different tables.
In answer to your question, a plugin you could use for this is Multi DB https://premium.wpmudev.org/project/multi-db/. Although this plugin is no longer officially supported by them anymore, it's still compatible with WP 4.5.3 according to the site.
As for redundancy, you could run 2 linux VM's for hosting the databases, one a primary, one a failover
If you've heard of EduBlogs (Like Wordpress.com, but for education), they host about 3 million blogs using Multisite. The guys behind it are WPMUDev (Linked to above) but here they have a thorough article for Multisite for a large number of sites and the potential Database issues you may encounter: https://premium.wpmudev.org/blog/ultimate-guide-multisite/

WordPress multi site installation

i have 3 self hosted wordpress sites in same machine but each one uses different url as explained below.
publication.mysite.com (wordpress site)
info.mysite.com (wordpress site)
flipbook.mysite.com (wordpress site)
now mysite.com is our primary company's website. it is a sharepoint site. because of this i cannot create mysite.com as our primary wordpress site.
i want to keep publication.mysite.com as our primary wordpress site and under this site bring the other 2 wordpress sites (multi-installation).
below is what in am trying to accomplish.
all 3 sites should consume it's own mysql database
all should be pointing to it's directory
all 3 sites url should not changed.
all posts, and other data in all 3 sites must be retained.
how could i do this? i tried to follow wordpress multisite installation documentation but i am stuck because i do not know how to setup as per my domain requirement.
another reason why i want to do this because of search. i have a global site search plugin from wpmudev. we need the ability to search from any one of our site to other 2 sites. for example: if i am searching for a 'productA'in one site, i need to display all post related to 'productA' from other 2 sites as well.
if there is any better way to perform global search like i explained, then i would like to hear about it
Thanks for help.
Your network-wide search functionality will be difficult to achieve if you must use separate databases for each site. It will require development chops that most people don't have. I respectfully suggest you reconsider that requirement.
Multisite search, in a single database, can be done with a plugin. For example. https://wordpress.org/plugins/multisite-global-search/
A WordPress multisite installation is designed to host sites with varying URLs. The migration isn't hard to do. You set up the target multisite system with three sites (blogs, WordPress's documentation calls them) in it. Rig the URLs for each of them.
This document explains the path to follow. https://codex.wordpress.org/Create_A_Network Multisite's administrative menu offers ways to configure the individual sites.
You then export the content from the individual sites and import them, one by one, into the target sites.
WordPress is decently well documented. Read this for an outline of the process of migrating to multisite. https://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite

Partial WordPress Multisite Migration

I have a WordPress Multisite that I use for several projects while they're in development - and then migrate a single install when I'm moving to a new server / domain.
The problem I'm running into, is that I have 3 sites within this multisite install (of 6+ sites total) that I need migrate to a different server, but am not sure how to only export only the parts of the database that are needed for these 3 sites (with wp id's of 6, 7 and 8).
I've been using this guide - which is slightly problematic since I only need THREE of the sites databases exported, but still need (at least some) of the multisite tables exported as well.
Any one know of any links to guide me in the right direction? Thanks!
I would suggest exporting all of the context via something like All-in-on-migration (you'll need the premium version for multisite) (documentation is POOR) and then exporting it all as the most up to date version, then removing what you don't need.
Partial migrations are a pain. I've not managed to do one that's not very messy. It's a problem I am trying to solve right now. Hence coming across this post.

Wordpress Development VS Production Environments

I am about to use WordPress as CMS with a lot of customization, but my question is, how should I sync development to production?
Assuming WordPress is not used, a typical development cycle is to develop the pages locally, and create the DB scripts. Then when everything is ready, it is posted to the site. And then again, more db and code changes, then only the changes are updated/applied, and so on.
Now, with WordPress, you get all the great features (one example is blogging, comments, almost ready CMS ...etc). However deployment is a pain! Ideally, I would rather keep my typical development cycle described above. Therefore I am going to be implementing WordPress locally (from wordpress.org) and then pushing the changes to my production server.
So, assuming that I create a new page in WordPress locally (I will never create pages on the server, all locally, I will find a way to disable wp-admin for the server), a number of files are created. This is not a problem so far. HOWEVER, if I want to add content to that newly created page, that content is saved to my local database. Even though that content is a database change, it is considered (from my point of view) a new change that should be pushed to server rather than add that content via the live server (because that content is considered static, it is not a blog post or a comment, it is a static page).
Now, that new page content is saved to the DB, and therefore, the DB will have changes done on my local machine that I should push to the server along with the files that I will FTP to the server.
My questions are:
Is this approach correct? If not, what do you suggest
What is the best way to find database diffs? What is a tool to use? Does MySQL Workbench provide something like that? I intend to use that tool to find diffs and then generate an update script for the DB. The reason for this question is I normally make the changes myself, and I know how to track them, but now, those DB changes are generated by WordPress and I need to reverse engineer them to find out which changes are made.
Assuming I got step 2 to work, is there anything in that script that should be modified? Such as server names? Does WordPress hard-code server names for example?
So to summarize and give you more information about my development environment, I use XAMPP for development on Windows 7, with PHP and MySQL setup. I also use Mercurial for source control. As mentioned above, I will use WordPress as part of the solution and I intend to use it to help me create a CMS solution. I will use it locally for page generation, and disable that feature for online (keeping online for blog posts and similar entries only). I am doing that so as to keep things in-sync. If I create a page locally, some data is saved to the DB. Now, how do I sync/upload?
Thanks.
OK, after further investigation, here is what I concluded.
All theme development should be version-controlled
All plugin development should be version-controlled
Content of pages and posts are not part of the development porcess, this is contect and should only be backed up.
This way, you do not need to worry about DB changes ...etc.
Hope this helps everyone.
You might use a Version Control System? What OS is the development on, e.g. Win or Linux? And what is the production OS? I use http://serverpress.com for my testing environment though there are others, WAMP, LAMP, etc.

Categories