• Resolved SARguy

    (@sarguy)


    I have two problems that I am running into for which I would appreciate if someone can provide some ideas as to what is causing the issues.

    First some background info.
    Wordpress version: 3.2.1
    O/S: CentOS release 5.6
    Multi site enabled: yes (using subdirectory sites)

    I currently have a website, let’s call it ‘devsite.mydomain.com’ which currently resides at ‘/usr/local/www/html/devsite’ on my server. I want to change the physical location of the site to ‘/usr/local/www/html/mysite’ and the url to ‘mysite.mydomain.com’.

    This is what I have done:
    1. made backups of the database and the files.
    2. export the contents of the devsite database (called devDB in mysql) to a text file using: mysqldump -u dbusername -p’dbpassword’ devDB > devDB.DB.currentdate
    3. Copy everything in the file system to the right location: cp -Rp devsite/* mysite/
    4. Open the mysql database dump in a text editor and replace any instance of the old FQDN URL (‘devsite.mydomain.com’) with the new one ‘mysite.mydomain.com’.
    5. Open the mysql database dump in a text editor and replace any instance of the old file system path ‘/usr/local/www/html/devsite’ with the new one ‘/usr/local/www/html/mysite’.
    6. change the wp-config.php file so that the line that reads “define(‘DB_NAME’, ‘devDB’)” is changed to “define(‘DB_NAME’, ‘myDB’)”
    7. change the wp-config.php file so that the line that reads “define( ‘DOMAIN_CURRENT_SITE’, ‘devsite.mydomain.com’ )” is changed to “define( ‘DOMAIN_CURRENT_SITE’, ‘mysite.mydomain.com’ )”
    8. Import the changed mySQL dump file to the new db: mysql -u dbusername -p’dbpassword’ myDB < devDB.DB.currentdate

    This is my first problem. The following is what happens:
    – I am able to load the main site just fine.
    – If i try to visit any of the sub sites, I get a 404 error
    – I log in to the network admin dashboard for the main site and if I go to the ‘All sites’ area I can see all the sites are listed. If I click any of them I can see all of that site’s information. I tried updating each site but still no dice. If I click on the dashboard link for each of those sites I still get the 404 ‘website not found’ error.

    This is what I have done without any results:
    – Restarted httpd
    – checked all file system permissions to make sure they matched the original location.
    – checked all db permissions
    – repeated the process twice.

    This is my second problem:
    On the ‘devsite’ I have the first user created (id of 1 on the DB) called ‘devsiteadmin’. I would like to change this to be called ‘mysiteadmin’. On the instructions I wrote above of what I did to migrate the site. I have an extra step in between #4 and #5. Let’s call it step 4.5. What I do is I open the mysql database dump in a text editor and replace any instance of ‘devsiteadmin’ with ‘mysiteadmin’. there are only 5 locations where this is changes, 3 of them are in the wp_users table, one in the wp_sitemeta table and one more in the wp_usermeta tables. After doing this I follow the rest of the instructions as mentioned above.

    However, this is what happens:
    – I still have the same issues as in the problem #1: I’m able to access the main site but can’t access children websites and get the 404 error not found
    – When I log in to the dashboard for the main site, I can no longer get to the ‘network admin’ site. The option does not appear in the menu on the top right under my name any more. If I try to force it by typing in: ‘https://mysite.mydomain.com/wp-admin/network/&#8217; I get a blank screen with a message that says: “You do not have sufficient permissions to access this page.”

    Any ideas anyone?
    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter SARguy

    (@sarguy)

    Ok I solved the first problem. I looks like I had failed to copy the .htaccess file at the root of the site, looks like the command I ran above does not copy ‘hidden’ files.

    However, I am still having problems with the second issue which is that if I change the name of the first admin user I can not log in to the ‘network admin’ part of the site. I do not have other admin users to test and see if they can log in and see the network part of the site.

    Any ideas?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    However, I am still having problems with the second issue which is that if I change the name of the first admin user I can not log in to the ‘network admin’ part of the site. I do not have other admin users to test and see if they can log in and see the network part of the site.

    Sure, that one’s easy ??

    The database saves your IDs in a string and it records how long the string is.

    Go into wp_sitemeta

    Look for site_admins and you’ll see something like a:2:{i:0;s:7:"Ipstenu";i:1;s:7:"Lpstenu";}

    a:2 means there are two admins.

    s:7 means that Ipstenu (and Lpstenu) have seven characters in their names. Change the name, change the string length too.

    Thread Starter SARguy

    (@sarguy)

    Ipstenu.

    This works, thank-you. I’m glad I asked as I wouldn’t have known how to fix this one.

    Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can't access children sites after website location was moved’ is closed to new replies.