• Hey guys

    I assumed migration would be a matter of 15 minutes. And now 2 days later I still did not get started… So I need a good advise and direction.

    I backup with updraft normally. Now I have made a local multisite and wish to migrate to public. As it turns out none of the migration tools do multisites without pro.

    All I need is transfer what I build and then run things from server. so I am not going into a pro subsciption for now.

    If anyone knows a quick and dirty solution that does this correct, I would be really happy. My WP at host is a fresh one click install, so I am fine with trial and error. I can reinstall and start over.

    I am concidering manual and I came across this manual scenario #3, I assume will work.

    I took a backup from File Manager Plugin. It appears to freeze after DB is ok and then it just hangs there. Again I suspect Multisite issues.

    I am on a Local app install on Mac. Local can backup, but what do I then do over at host? I assume Backup and Restore must be done with the same pack and unpack framework.

    So right now. How do I even get to initiate my manual process?

    • Registrar at Cloudflare is set up and pointed to host.
    • Host is in place and pointed to domain.
    • WP one click install is ready and wp-config.php edited for large file upload in both ends.
    • I plan to use search and replace plugin for DB table changes.

    So how du I get my backup and then how do I run it on server without a subscription somewhere.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Copy the files, and import the database to your host.
    Set up wp-config.php to point to the right database / password

    use WP CLI to change the domain names ( change as appropriate)

    # multisite search replace
    wp config set DOMAIN_CURRENT_SITE "multisite.blahnew.net"
    wp search-replace "localhost" "multisite.blahnew.net" --url=multisite.blah --precise
    wp search-replace --network "http://localhost" "https://multisite.blahnew.net" --precise --all-tables
    Thread Starter hebhansen

    (@hebhansen)

    Thx Alan

    • Local app is nginx server where host is Lightpeed. Is that a problem? I can try to clone in local onto Apache if needs be, but I do not have Lightspeed in local. For now I assume wp does not care what the server is.
    • I have disabled security plugin. I am uncertain about SSL handling. Complianz does it on local and plugin is left on for the export.
    • In Local app I have exported the multisite (Core and only 1 subdomain and I want it to stay like this. So a clone). It’s called mysite.zip
    • I have saved my DB from local
    • Over on mysite I have the domain at cloudflare and it’s pointing correctly towards my host server (Lightspeed)
    • Records are ok in both ends
    • WP one click install single site runs at mysite.com
    • I altered wp-config.php for large file 540 MB was needed and I have set it down again.
    • mysite.zip was unpacked in public html at mysite.com and I assume files overwritten correct. Zip file deleted
    • config.php changed back to “normal upload sizes” and files updated to mysite.com as well as set for multisite
    • I have NOT changed any DB settings in config.php as they seem to be set correct for the oneclick install of wp.
    • mysite.com is now broken…
    • DB restored through Cpanel WP Tools and there is 4 DBs. This is something I mess with every second year, and here it get’s hazy.
    • I tried to run an sql query in all DBs but they were rejected. Not authorized, so assumably no change to any of the DBs
    • But just to clarify. 2 of the DBs are running on mysite.com right? But now a mess since the WP was overwritten? And the 2 other are from Local and looking for mysite.local that is now absent?
    • So wp cli is run from terminal in cpanel advanced and it warns me when I access that I am in dire straits. I accept that situation and I have terminal in front of me looking into dire straits.
    • So your command for cli is:
    # multisite search replace
    wp config set DOMAIN_CURRENT_SITE "mysite.com"
    wp search-replace "localhost" "mysite.com" --url=mysite.com --precise
    wp search-replace --network "http://localhost" "https://mysite.com" --precise --all-tables

    I do not understand how and where it knows where to copy tables from? The two other DBs from local?

    Do I need to do more in config.php?

    If we can stick to:

    mysite.com (New public single site)

    mysite.local (multisite to be migrated/cloned/moved/transferred)

    I will wait to hear your comment. Dire Straits you know.

    Thx

    Thread Starter hebhansen

    (@hebhansen)

    Also… Do I need to install wp cli or is Terminal my wp cli?

    Thread Starter hebhansen

    (@hebhansen)

    added to config.php

    define( 'WP_ALLOW_MULTISITE', true );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'mysite.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
    @ini_set( 'upload_max_filesize' , '128M' );
    @ini_set( 'post_max_size', '128M');
    @ini_set( 'memory_limit', '256M' );
    @ini_set( 'max_execution_time', '300' );
    @ini_set( 'max_input_time', '300' );
    
    define('WP_HOME','https://mysite.com');
    define('WP_SITEURL','https://mysite.com');
    
    

    On your new site delete all files except wp-config and .htaccess

    Copy all ( except wp-config.php and .htaccess ) files from your localhost install to your new site

    Dump your localhost database, you can use wp cli, mysql or any tool of your choice

    Remove all tables from you new site and import the dumped database, you can use what ever tool you are comfortable with

    You will have everything EXCEPT you will have the wrong URLs in the database

    use WP Cli search replace, as described earlier, to search all your localhost urls into your new domain urls

    • This reply was modified 2 years, 5 months ago by Alan Fuller.
    • This reply was modified 2 years, 5 months ago by Alan Fuller.
    Thread Starter hebhansen

    (@hebhansen)

    multisite.blahnew.net = mysite.com ???

    localhost = localhost ???

    url=multisite.blah changes or not ???

    • This reply was modified 2 years, 5 months ago by hebhansen.
    Thread Starter hebhansen

    (@hebhansen)

    There is no .htaccess on my new site

    Thread Starter hebhansen

    (@hebhansen)

    htaccess was hidden. It’s there now

    Thread Starter hebhansen

    (@hebhansen)

    I am not comfortable with any method. No commands work in terminal folowing this:

    https://blog.cpanel.com/wp-cli-install-and-manage-wordpress-on-the-command-line/

    Sorry you are having difficulty. Multi site and localhost is not the simplest of solutions so I assumed perhaps a higher level of experience and skill.

    perhaps someone else can add so help.

    Thread Starter hebhansen

    (@hebhansen)

    • Site uploaded
    • DB tabeller er kopieret fra gammel db over i live db
    • mysite.local er search replaced med mysite.com
    • mysite.com viser en blank hvid side istedet for 403 og nothing there. Så noget må være på vej…
    • Jeg får denne fejl:
    Error: Site 'mysite.com/' not found. Verify DOMAIN_CURRENT_SITE matches an existing site or use --url=<url> to override. [error]FailedToExecuteWpCliCommand: exit status 1[/error]

    DOMAIN_CURRENT_SITE er i config.php sat til mysite.com – Hvad gør jeg nu?

    Backup kommer fra local install og der er ikke en .htaccess med. Er det et problem?

    Thread Starter hebhansen

    (@hebhansen)

    In fact, I do search and replace in PHPMyAdmin but tables are not replaced from local > com. Why?

    Thread Starter hebhansen

    (@hebhansen)

    Things seems to be kind of sorted. There is no theme or plugins in my backup. Is there an easy way to batch sort this as opposed to download one by one?

    Search and replace in PHPMyAdmin is not the recommended methods as it may cause issues

    see https://wordpress.org/documentation/article/moving-wordpress/#changing-your-domain-name-and-urls

    Things seems to be kind of sorted. There is no theme or plugins in my backup. Is there an easy way to batch sort this as opposed to download one by one?

    Can you not copy the files from your localhost?

    Of course if you had WP CLI working you could use that https://developer.wordpress.org/cli/commands/plugin/install/

    Thread Starter hebhansen

    (@hebhansen)

    Recap

    • Migration: Check
    • Somehow the WP install was looking into the wrong DB, hence no info on plugins and theme. I installed those manually and all settings were ready in the copied DB.
    • I managed to install a WP in Public > App > Public > another WP. CPanel wptoolkit was complaining about it, and it seemed odd. I was not certain if this was the site within the multisite install, but it wasn’t This bad WP was pointing into old and accurate DB. After copying and securing old DB into the new DB, I have now placed this odd wp in my bin. Everything seems fine without it. I will delete it from bin in a few days. There is also a Public > App > Public > sql > database. Is this the one WP is running from or is that an orphan child now?
    • Cache, Security, analytics and CDN should now be in place and working.
    • Backend looks like a multisite install with main dashboard and site #1 dashboard
    • For fun I installed a new site. It says no theme and it also says can’t be accessed when trying the link. Did I kill the multisite function now? I am suspecting that maybe I missed something here. However, I did keep the new DB but deleted all tables. And then copied the correct tables from old > new, so I assume these are fixed:
    • blogs > domain
    • options > home
    • options > siteurl
    • site
    • sitemeta > siteurl

    But how about these where # is site id?

    • #_options > siteurl
    • #_options > home
    • #_options > fileupload_url

    I assume my first site is ID#1. Then what do I do, and is this the reason why the new site is not working?

    Thx

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Migration Multisite Domain from Local to Host, advise’ is closed to new replies.