Swapping installs and directories locations


I have a WordPress one-click install set up at my main domain, with a Mediawiki one-click install in a subdirectory. What I’d like to do is to swap them around (swap WP @ “mysite.com” with MW @ “/wiki” for MW @ "mysite.com and WP @ /blog). I’m just not generating content for the blog like I used to.

I’m thinking that the process is pretty simple, actually, but I was hoping someone might let me know if I’m missing any steps.

  1. I’ve backed up my sites.
  2. Uninstall both.
  3. Reinstall MediaWiki, then WordPress.
  4. (the big question for me) Upload data from my backup folder and overwrite the data from the fresh installs.

I guess, what I’m wondering is whether there will be some hang up in the uploading and overwriting process. I’m thinking I should make a copy of the backup files — renaming the “mysite.com” folder “blog” and changing my MediaWiki subdirectory folder “wiki” to “mysite.com.”


Your steps will work, but that’s a ton of data to push around. To make some things easier, you can copy them locally on the server as you mentioned, and use new databases for the new installs.

From command line, ‘cp -R ~/example.com/wiki ~/example.com/wiki.sav’ and 'cp -R ~/example.com ~/example.sav’
You can use a similar process to put them back where you want them. And you’ll have an extra wiki buried in your blog you can then delete.

For the database, you can use phpMyAdmin to Drop all tables from the newly installed one-clicks, then do a command-line migration:


Thanks for the info. I’m really a novice, so I’m not really sure how to go about using your process. I ended up just trying it my way, and I’ve got the new installs up and running. However, even though MediaWiki was set up to use my old wiki database, that data isn’t appearing.

As far as I know I only need the LocalSettings.php to look for that database:

Database settings

$wgDBtype = “mysql”;
$wgDBserver = “mysql.example.com”;
$wgDBname = “exampledatabase”;

Am I missing something? The same thing is happening with the new WordPress install. It works, but none of the old posts/comments/link lists appear.

When you did the new installs, did you tell it to use your old database? What did you do with your old data? Does it show up if you point your browser to mysql.example.com? That LocalSettings file also has a wgDBprefix that needs to match the table names in the database.


“When you did the new installs, did you tell it to use your old database?”

Right. When I did the reinstall I pointed MediaWiki to the existing database, and that’s the one I cited above.

“What did you do with your old data?”

I downloaded the database and the site directory/folder . . . and left the database in place (dreamhost says they don’t delete your databases when uninstalling programs).

“Does it show up if you point your browser to mysql.example.com?”


“That LocalSettings file also has a wgDBprefix that needs to match the table names in the database.”

This is what I’m seeing in the file and what might be the problem:

MySQL specific settings

$wgDBprefix = “”;

In the old site’s LocalSettings file this was:

MySQL specific settings

$wgDBprefix = “wiki_”;

But I’m not sure if this is what I need to set it to be or how this gets set in the first place. How does the prefix get determined? The install process doesn’t mention it (as far as I remember it).

UPDATE: Adding “wiki_” worked! Still, I have no idea where one would get this info if not from the forum.

Of course, I’m having the same issue with the blog: www.example.com/blog. I know it’s pointed to the preexisting database, but I don’t know what (file) to edit or add.

The new problem is with the blog database. I added the prefix for the database into the config file, but then the blog theme disappeared and I cannot login - getting a 404 error.

I’ll keep playing around.

So you found the WordPress table_prefix, which is good. Even without the theme, you should still be able to log in to wp-admin. You can’t?


No. It returns the 404 error every time:

"The requested URL /wp-login.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Weird. Because I’m reading through the wp-login file right now, so it is there.

Using the prefix in the new installation config file, I can login in and do everything expected, but once I change it to the old (desired) db prefix, all I get is the data and no theme or login ability.

If you use phpMyAdmin to log into your WordPress database, are the old prefix tables still there?

It also may be .htaccess that’s throwing things off. FTP in and be sure your FTP program is showing hidden files. Rename the .htaccess to .htaccess.sav and then try wp-admin. Re-setting your Permalinks under Settings will properly rebuild the .htaccess file. But first update your General settings for the new URL.


Yeah. In phpMyAdmin has the old tables and the new ones that were in the config file for the new install.

Sorry. Even with view hidden files on, I can’t locate the .htaccess file. I’m using CyberDuck.

Maybe I don’t have one and need to create one?

If there are no .htaccess files, then it’d still function if all else was correct.

Edit the old table “options” for the “siteurl” and “home” entries to reflect the new layout.


That was it. Just updating the siteurl.

Thanks, Scott!!! I’ve learned a lot.