WordPress.org

Ready to get started?Download WordPress

Forums

Moving WordPress3 Multisite Install Directory: 500 Internal Server Error (7 posts)

  1. Dan & Jennifer
    Member
    Posted 3 years ago #

    Hi guys! Running latest wordpress 3.1.3, MultiSite (with 3 sub-sites). configured to use directories, not domains. Working great, no problems at all.

    However - I had to move the whole wordpress to a new domain (and thus a new installation directory).

    PROBLEM: As soon as I moved it, the site won't come up at all anymore. I get HTTP Error 500 (Internal Server Error).

    Bizareness:
    What's really weird is that if i make a directory level symlink (ln -s original-install-dir-name new-install-dir-name) then suddenly the wordpress (and all 3 subsites) work perfectly on the new domain.

    So that means that somewhere, somehow, in some multisite or wordpress config file, the old directory is still hard coded.

    What error logs say:

    the error_log file in the wordpress install root says:
    [03-Jun-2011 23:22:32] PHP Fatal error: require_once() [function.require]: Failed opening required '/home/user/public_html/xxx//wp-includes/class-wp-error.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/xxx/wp-load.php on line 48 ** yes that is a double "//" in the error log, I did notice that as well.

    Migration process: Followed the Codex "Moving wordpress directions" for moving multisite (though they are very sparse).

    Steps taken to migrate:
    - edited the wp-config.php: changed domain - the install dir is not specified in that file at all
    - per the Codex, opened database in phpMyAdmin and manually changed wp_options, wp_2_options, wp_3_options, wp_site, wp_site_meta - i think that was it - basically searched for any place where there was the name of the old domain (same as the install dir) and manually replaced those.

    Background (probably not relevant, but just in case):
    Our production website Ask Dan & Jennifer is made up of 3 wordpress installs. We're consolidating those into a single WordPress Multisite (directory-based).

    However to prevent downtime, made a copy of all files in that wordpress and the whole database, and restored it perfectly under this temporary domain. that worked great. then upgraded to multi-site and imported the 2 other sites as sub-sites. again, all worked perfectly.

    Before deploying this to production, I'm doing a test migration of this temp domain to a 2nd temp domain - to be sure there are no problems moving wordpress multisite. glad I did that, since you see the problem I ran into. :-)

    Any ideas?

    Thanks!
    Dan

  2. So that means that somewhere, somehow, in some multisite or wordpress config file, the old directory is still hard coded.

    per the Codex, opened database in phpMyAdmin and manually changed wp_options, wp_2_options, wp_3_options, wp_site, wp_site_meta - i think that was it - basically searched for any place where there was the name of the old domain (same as the install dir) and manually replaced those.

    You followed the single site instrcutions.

    You need to do a search 7 replace on the entire database.

  3. Dan & Jennifer
    Member
    Posted 3 years ago #

    Hey Andrea! LOL yeah, followed the "moving multisite" instructions on that page, though they are quite brief. regardless it implies it's the same process as singlesite, just more involved, and that it was. :-)

    over last cpl of years I've moved wordpress (single site) many times manually - just by changing the domain/url/paths in the database with phpmyadmin, worked flawlessly.

    You need to do a search 7 replace on the entire database.

    Agreed, forgot to mention that above. so yesterday I figured out how to do that easily on the server... exported the whole db to a text file and searched it for the unique string that the domain and URL share (what i've been replacing).

    here's how i did it

    `mysqldump --opt --default-character-set=utf8 --skip-extended-insert --user my_user --password my_db -r exp-utf8-2011-06-03.sql --log-error=log-mysqldump.txt
    grep -i "/my-path-here/" ./exp-mydb-utf8-2011-06-03.sql > find.txt`

    I know this works because I did find 2 places i had missed it (wp_2_options i think - some plugin setting) - and fixed that, but no go, still broken, same error.

    My question - could that directory path be hard coded in any text file in the whole multisite install? i've gone thru wp-config.ph and .htaccess and it's clean, but could it be anywhere else?

    that is what it's looking like for me... because it's not in the database anymore, so that means it has to be in a file. but i dont have a way to search files as easily as i can search the db... plus it gets ALL the error_log files which contain plenty of this error with that exact string, argh.

    also completely uninstalled w3totalcache and removed all cache files - just in case, so that's not it.

    Thanks!
    Dan

  4. could that directory path be hard coded in any text file in the whole multisite install? i've gone thru wp-config.ph and .htaccess and it's clean, but could it be anywhere else?

    No. Every other core files gets overwritten on upgrade, so it wouldn't even make sense to do that.

    A 500 error is a server-side error too, not wordpress. ;)

  5. If you moved from a subfolder, like domain.com/testfolder to domain.com then you need to ALSO search for /testfolder/ in the DB, not JUSt the whole URL.

  6. Dan & Jennifer
    Member
    Posted 3 years ago #

    ***** It works now!!! ****
    Turns out to have been some type of caching issue, because after making all the db changes as expected it did NOT work, but a few hours later it magically did.

    @Andrea agreed - though a broken config (read: user error / typo lol) can still cause that type of server error.
    Your tip was very helpful btw - I was concerned that Multisite may be hard-coding the filesystem path in a config file somewhere, and you assuring me it does not definitely helped. :-)

    @Ipstenu thanks, great point, though in this case I literally only moved domain1.com to domain2.com, same directory structure.

    So, it works.... we've been running our production site on WP3 Multisite since the last migration Saturday morning (2 days now), and it's been working flawlessly with the 3 previously separate wordpress installs as sub-sites.

    The main website - Ask Dan & Jennifer
    - 1st sub-site - Ask Dan & Jennifer - Love & Sex Reviews
    - 2nd sub-site - Ask Dan & Jennifer - Best Sex Places

    Before the migration-to-production I did some further testing and narrowed this down (and was able to duplicate the error scenario on the 2nd test move btw) - will update the ticket with more details for future queries.

    Thanks guys for the quick answers!
    Dan

  7. Interesting... That sounds like server-side caching (which I know you can force dump with a restart of httpd, though that's really overkill). What server-side cache do you use? APC, Memecache...?

Topic Closed

This topic has been closed to new replies.

About this Topic