Announcement

Collapse
No announcement yet.

How do I change the installation directory?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] How do I change the installation directory?

    Hello! I've managed to make a copy of my live site for testing purposes, via a fresh installation, identical modification installations, identical theme installation, and then by copying my sql tables into the database for my test installation. I then altered my config file to stop looking at the original table prefix and look for the new table prefix. Then I loaded the page and everything looked perfect...


    ...EXCEPT for one tiny detail. The installation itself thinks that it is still located at www.mydomain.com instead of test.mydomain.com. Ever single link and redirect on the site is set to load www.mydomain.com. If I manually type in the addresses replacing the www with test the pages all load correctly, but I need to know what to edit to make the test installation start linking to the correct locations.

    Do I need to edit one of my mysql tables? If so, which one?

  • #2
    Originally posted by Webbstre View Post
    Hello! I've managed to make a copy of my live site for testing purposes, via a fresh installation, identical modification installations, identical theme installation, and then by copying my sql tables into the database for my test installation. I then altered my config file to stop looking at the original table prefix and look for the new table prefix. Then I loaded the page and everything looked perfect...


    ...EXCEPT for one tiny detail. The installation itself thinks that it is still located at www.mydomain.com instead of test.mydomain.com. Ever single link and redirect on the site is set to load www.mydomain.com. If I manually type in the addresses replacing the www with test the pages all load correctly, but I need to know what to edit to make the test installation start linking to the correct locations.

    Do I need to edit one of my mysql tables? If so, which one?
    Check your cookie settings in the ACP.


    vB5 is unequivocally the best forum software, but not yet...

    Comment


    • #3
      I can't actually access the ACP right now, because the settings are wrong and it just redirects me (and attempts to log me into) the location of my live site. Any idea which sql table that is in? I could easily switch in the unchanged table instead

      Comment


      • #4
        I'm getting closer to the answer, maybe someone with mysql knowledge can help here.

        I found how to reset the cookie path with the tools.php file, but that didn't solve the problem, which only leaves the Forum URL location as the culprit. I found this post from someone else who needed to change his forum:
        http://www.vbulletin.com/forum/showt...=1#post1715598
        You would have to change this directly in the database in the settings table (varname='bburl') and possibly datastore.
        I have found the location of bburl using mysql, but I'm not sure how to edit it. Anyone know how to edit fields in mysql?

        Comment


        • #5
          I tried switching in the original datastore and setting tables, but when I put in the datastore it started only loading white blank pages. I switched the datastore back to the copy of the live site's table, and the site was loading again, but still every link points to the www.mydomain.com instead of test.mydomain.com. I then used tools.php to try to repair all of the tables, and now everything other than the login page for admincp is a blank white page. The one plus side is that the login page no longer tries to redirect you to the live site... only another blank page.

          I looked at everything in the vbulletin manual page ( http://www.vbulletin.com/docs/html/blank_pages ) about white pages, but considering that I cannot access admincp and I haven't done anything to the other files it suggests, I have no idea what to do next. Any suggestions?

          Comment


          • #6
            Working!

            Ok, I have managed to install a duplicate copy of vbulletin4 in my test domain, with all of the exact same data. I'm going to tell you all EXACTLY how I did it, because it can work for test domains or for people who have moved servers and cannot access admincp. Someone PLEASE put this info somewhere or sticky it so that no one else has to go through all of the trouble I had.

            Here is what you do:
            1. Install the exact same version of vbulletin in your test subdomain (test.yourdomainname.com). Be sure to use a different prefix for your mysql tables than your live site uses. For that matter, it is safest to make a new database for those tables so that your test site doesn't do anything to your live site.
            2. With your products page open in one tab of your browser, compare the list of products you need to install and install the exact same versions to your test subdomain.
            3. Export your theme from the live site, then import it to your test site.
            4. Copy any custom images or files (in my case I had customizations and a downloads II database installed) from your live site to the exact same locations in your test site.
            5. Copy your entire mysql database from your live site, upload it gzipped to your server, and then use this command via shell to copy it to the same database as the test installation:
              Code:
              zcat path/to/file/name.sql.gz | mysql -h [COLOR=red](localhost OR your mysql server location goes here)[/COLOR] -u mysqlUsername -p'password' mysqlTable
            6. Now go into your includes/config file and change the prefix to match the same prefix your live site uses. Again, you should have your test install in a DIFFERENT database than your live install for safety.
            7. Now if you go to your test.mydomainname.com address you will see the site loads up, but all of the links and redirects take you to the wrong place and you cannot log in to admincp. This is normal, so continue on:
            8. Using myphpadmin (or if you are smart enough to use shell - I'm not - use that instead) go to the database for your test installation. Find the copy using the correct prefix (which you set in Step 6). Now go to your prefix_datastore and prefix_setting tables, go to the Export tab, and export the .sql files for both.
            9. Using a safe text editor (I usedNuSphere PhpED - I highly recommend it) do a find and replace for both files to change www.yourdomainname.com to test.yourdomainname.com.
            10. In myphpadmin go to the prefix_datastore and prefix_setting tables, go to the Operations tab,and rename both to something else. I suggest tacking _old on the end.
            11. Now at this point I tried using myphpadmin to import the new files, but chances are the datastore will be too big, so I suggest gzipping both files individually and running the shell command from step 5, but with the file name changed. Do this once for both files.
            12. At this point the site should know that its Forum URL has changed, but it MIGHT start freaking out on you. This would be because of plugins with setting problems. Go into your config.php file again and add define('DISABLE_HOOKS', true); to the top of the script, just under the opening php tag. This should now allow you to access the site and admincp, and make any remaining changes you need to make the site a fully functional copy of your live site: PERFECT for testing upgrades and add-ons and whatnot because it contains all of the same data as your live site.
            13. Last note: Be sure to remove the hook disable once you have fixed everything up in admincp!


            Hopefully this will help others, cause I had a hell of a time trying to figure out what to do. If you run into any other problems, such as cookie problems, you can try using the tools.php script for those things.

            Comment


            • #7
              I had to go through all this again today, only to find a much easier solution:

              Copy everything over, files and sql database, go into phpmyadmin, browse the prefix_setting table for anything with an "url" in it and change any values that are listed as www.yoursite.com to test.yoursite.com. Then go into the prefix_datastore table, browse, edit options, and again search for anything with a www.yoursite.com in it and change the values to test.yoursite.com. This appears to, in the absence of hardcoded modifications, make it so you can just copy your site over and not go through all the steps above.

              Extra Notes: Disabling all hooks, and making sure you turn off or change vbulletin's caching is vital to making this work, or else it will serve up pages from the cache of your live site.
              Last edited by Webbstre; Sun 19 Aug '12, 4:32am.

              Comment


              • #8
                I always recommend:

                - change URL first and Save
                - backup database
                - change it back
                Vote for:

                - *Admin Settable Paid Subscription Reminder Timeframe*
                -
                *PM - Add ability to reply to originator only*
                - Add Admin ability to auto-subscribe users to specific channel(s)
                - "Quick Route" Interface...

                Comment


                • #9
                  Haha, thanks Trevor, but I tend to have bad luck when I fiddle with things on a live site. If I tried it there then before I knew it I'd be logged out before I could change it back and would have to go in and edit it anyways :P

                  Comment


                  • #10
                    Originally posted by Webbstre View Post
                    I had to go through all this again today, only to find a much easier solution:

                    Copy everything over, files and sql database, go into phpmyadmin, browse the prefix_setting table for anything with an "url" in it and change any values that are listed as www.yoursite.com to test.yoursite.com. Then go into the prefix_datastore table, browse, edit options, and again search for anything with a www.yoursite.com in it and change the values to test.yoursite.com. This appears to, in the absence of hardcoded modifications, make it so you can just copy your site over and not go through all the steps above.

                    Extra Notes: Disabling all hooks, and making sure you turn off or change vbulletin's caching is vital to making this work, or else it will serve up pages from the cache of your live site.
                    is this solution still valid today?
                    I am regularly losing my Facebook likes and thought moving the forum to a subdirectory might be the only valid solution. Is this right?
                    .

                    Comment


                    • #11
                      That should still work for VB4 moves, yes. Be sure you have a backup first.

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X