Local Mamp WP Multi-Site Deploy to Live Site Subdomain?

I'm having a hell of a time making the transfer from a local MAMP site to the live site.

I've used every possible plugin for this. All kept giving one error or another. So I tried exporting by hand.

I did a search and replace of the database for "http://localhost/" "http:disappointed:newdomain.com/beta".

Everything transferred properly. However, I'm getting the error "Error establishing database connection"

I suspect it has something to do with something getting messed up in the search and replace. Or it's something related to mulit-site.

Any ideas?

  • aecnu

    Greetings magi,

    Sorry to see that you are having such a hard time with the transfer and is why I advise all to develop on a live real server and save yourself a world of grief.

    However, lets see what we can do to deal with it in which it is obviously a database issue and probably a naming issue.

    What is the name of the database on your local install?

    What is the name of the database on your live hosting install?

    On your live install does the database information in wp-config.php match that of the database itself on the live server?

    Please advise.

    Cheers, Joe

  • magi

    Well after 2 FREAKIN days of trying everything, here's the eventual solution to anyone in this same situation:

    Transfering MAMP wordpress Multi-site to live site:

    First make a working multi-site install on live site.

    Drop all tables in the live site database except:
    wp_site
    wp_site meta
    wp_blog

    export database from MAMP except the tables:
    wp_site
    wp_site meta
    wp_blog

    search and replace: http://localhost/ for http://sitename

    Save database and Gzip.

    Copy MAMP wp-content folder to live site (delete live site wp-content folder first).

    Import MAMP database into live site install.

    Keypoints:

    database connection errors were caused by something messed up in wp_site, wp_site meta, wp_blog

  • aecnu

    Greetings magi,

    Thank you for sharing that with us but folks, you can avoid all that messing around by doing it from a live server to begin with, having the domain right form the start, not have to worry about any of this by simply following these instructions:
    Two servers same domain name equals developers dream

    This avoids a lot of hassle for sure and gives one a live look and feel form the start.

    Cheers, Joe

  • johnpent

    Just thought I would share a great plugin for moving sites, multisites or otherwise.

    It is incredible, and is virtually flawless.

    WP-Migrate-DB - Version 0.4.3 | By Brad Touesnard | Visit plugin site

    It is wonderful for two things:

    1. Moving from Mamp or other local server to the web.
    2. Moving sites - even huge ones - from one server to another.

    It does all of the things you would go in and do manually for hours or days. It changes the path, updating the code with the correct character count. Changes the url.

    I use it to develop locally, and then deploy. I use it to create a basic template, and then deploy a near duplicate to other urls. Then I customize to fit the domain.

    I am using Headway Themes a lot, and even works flawlessly with that. Headways is very fickle at domain moves and changes. It works flawless. Also works with multisite.

    Love the price... free for this plugin!

  • Imperative Ideas

    Cheat code incoming...

    Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start

    Wait... hang on that's the wrong macro.

    If you export your DB to a .sql file, open it with a text editor, then search & replace the URL you will get vastly better results. Be sure to export your admin panel settings though because this particular technique will cause you to lose all of your customization options.

  • johnpent

    Keep in mind I am throwing this out there because it has save me many, many hours of work in the past few months.

    You said, "vastly better results." That's only if you have an efficient method of counting characters as you change the sql code. Try that plugin and you will see it does everything you could think of, including saving all settings. It's a clone.

    It does all of the sql coding you would do yourself. You end up with a CLONE of the site you were moving on the new server with all file paths and all url's correct.

    It does everything, and it saves a ton of hours.

    Anyone that opens a .sql file and does search and replace will have a nightmare of tedious work if the path has a different number of characters than the new server or the url has a different number characters than the new server.

    I am sure you mean that you would also go in and correct the character count on each line, but in most databases of any size that is impractical.

    This plugin truly does it all in about five minutes or less.

    I am throwing this out as a suggestion to try. There are two of us here that are using it every day, and it is wonderful.

  • Imperative Ideas

    I've worked with a lot of cloning software that misses details, especially in custom plugin tables. If it works for you, that's awesome. In my experience, half the time it works every time!

    I'll give this solution a try next time though because if it's as good as you say, then I'll be using it. A good DB migration tool would be worth its weight in... wait how much does a kilobyte weight anyhow?

  • aecnu

    Greetings Folks,

    I have already moved so many sites for other members, indeed dozens, from one server to another simply exporting and importing the database as an SQL file and FTPing the files down and up.

    To date failure rate is zero - database name can change it is is only a change needed in the wp-config.php file.

    It does not get any simpler then that and it involves not other software nor plugins - and just a bit of skill.

    Have a GREAT week ahead!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.