Installing a second forum for test/upgrade purposes

Started by willerby, July 22, 2009, 12:27:52 PM

Previous topic - Next topic

willerby

Been reading a bit about reinstalling SMF after my fairly heavily modded site is getting out of hand...

1. Am I right in thinking I can maintain my forum at ...mydomain/forum/ and set up a fresh install at ...mydomain/test/ but point it at the same database just by using a different database prefix?

2. If so, could I then take my time reinstalling the various mods on the new version (in maintenance mode?) while users continue playing on the original.

3. Then, when I'm happy is it simply a case of deleting the original and moving the new tested forum to mydomain/forum replacing the original?

This last step looks like I've missed something eg. having to change the domain stored in settings.php???

Or is this all wishful thinking?

I guess you can see where I am coming from - want to upgrade by reinstalling from scratch but trying to avoid downtime for users (and mistakes by me through rushing) until I'm really happy all the mods and themes are working as intended.

kat

Just thinking out loud, here...

If they share the same database, won't screwing one screw the other?

I'd imagine that you'd need to create a totally different database.

excaliburj

Quote from: Kat on July 22, 2009, 01:30:40 PM
Just thinking out loud, here...

If they share the same database, won't screwing one screw the other?

I'd imagine that you'd need to create a totally different database.

No, you can have different sets of tables within the same database. That's why $db_prefix is needed - to tell which tables WITHIN a database are to be used.
Random Sig Line

kat

Ta, mate. That's something I've learnt, today!  :)

excaliburj

Now, given that it's POSSIBLE, I wouldn't recommend it.

Using the SAME prefix in DIFFERENT databases makes it easier to use some tools (dump export from one and import to another or simple phpMyAdmin cloning). Or to safely drop the whole database once done playing or to start over from scratch (without risking selecting ONLY the right tables to drop).

So, unless there's a limit on databases in place at the host, I would avoid putting tables for multiple instances in the same DB.

Quote from: willerby on July 22, 2009, 12:27:52 PM
3. Then, when I'm happy is it simply a case of deleting the original and moving the new tested forum to mydomain/forum replacing the original?

This last step looks like I've missed something eg. having to change the domain stored in settings.php???

Or is this all wishful thinking?

A bit wishful. You see, a number of the mods you'll apply to 'test' may well come with changes to the database structure: new tables or new columns. These will not have been done to the 'live' DB. Nor can you simply start using the 'test' DB instead, as the 'live' one has continued to be updated (new topics and messages and PMs, even new users, and on and on) since you grabbed the original copy (unless you started totally blank, in which case you already KNOW you can't use the new, blank DB).
Random Sig Line

willerby

I thought it sounded too simple.  ::)

Ok, any suggestions as to how I can effectively reinstall and modify a complex site from scratch, keeping existing posts etc without having to rush it or having a major user downtime period?

The problem with so many mods and customisations which users now rely on is they take an age to put back in.  Constantly upgrading the existing forum and fixing errors is fine for a while but at some point you get so many minor unresolved bugs you just want to start again - all the wiser and hopefully, a little more experienced.

Norv

Well ... it depends.
It all heavily depends on what exactly these mods and customizations do. To the database.
Best scenario I can think of: you can make a test forum, import the (complete) database, run repair_settings.php to have the paths and all set to the test location. Then, start installing mods and editing code directly. Now, think of it this way: on the old forum you have a database with a structure composed of SMF initial structure, and whatever tables and columns your old mods added. On the new forum you start with a copy of the same altered database, but add eventually other alterations, like, added by different mods perhaps. (SMF+old_mods+other_mods)
Then, when done, and ready to switch to the test forum, you will want to import again the old site's data (to get the current posts/members/etc, and this time, it may be better to import data only, a backup made with phpMyAdmin's "use replace" option) in the new structure.
It should work... Then again, it depends: you may have a few surprises from mods which you had in both sites, which will bring their data from the old site, overwritting the (new) modifications made by you (like, let's suppose you add 2-3 custom field in users' profiles, different than those you added before in the old site: when you import again the database data to get the posts/members/etc... you get the old custom fields as well). Still, I think it may be better to do things this way, and until you manually set your mods' options back, the site would be probably functional, but not always how you wanted it. Is this a good idea? It depends, on your site's actual modifications...

Note: you could in theory import selectively instead, but then again, the success ... depends on what exactly the needs are. (personally I wouldn't recommend selective import, it may work, and it may turn into a nightmare).
Note 2: however, the above solution is less clean. Please note that by doing as said above, starting with a complete database transfered, you may get columns or tables of mods you had on the old site, that you won't reinstall in the new one. In other words, useless data and structure. They won't lead to errors, but uselessly load the database. Then again, they could be identified and removed anytime after, but it may require some work.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

willerby

Thanks Norv, that was really useful. I tend to forget that some of my mods add to/change the database quite fundamentally (most just play with the forum code) hence why I thought the two sites on one database might work!

I get the impression that these issues could become a bit of nightmare and, although I'm getting more competent with this stuff, maybe I should just start afresh on the live site in maintenance mode and alert users to the fact that downtime could be several hours.

I guess this way as each mod installs I can check its affect in phpMyAdmin and on the live site, ensure that the database is in synch and try and nail any errors as I go. The other way, I suspect everything would look fine on the duplicate test then when I converted to the live database error log hell would be created.

Thanks for bearing with me. 

Any tips on approaching the upgrade? My working plan is...

1. Overwrite my forum folder with the SMF2.0 RC1.2 Large Upgrade package files (deleting upgrade.php) and effectively clearing all mods. Check all ok on default theme.

2. Reinstall and customise member themes (I find having the theme in before applying mods often creates less issues on buttons/images etc and I can check that the themes work as I go)

3. Install SMF Gallery Pro, SMF Articles and SMF Links latest versions (check all still there and test)

4. Install Custom Pages and Custom Forms (both used on existing site) - test

5. Install Simple Portal - test

6. Install other minor display only mods (eg. no database impact) / make code changes eg. drop down menu


Basically, at each stage I will be installing the latest versions of mods. Am I better to install the existing versions (that match my current database set up) and then upgrade or go straight to the current version? Does it make any difference?

Any suggestions on better ways to achieve the same thing gratefully appreciated

W

Note: all mods are used on the existing site so nothing new apart from a number of upgrades.

Edit: Plan B - revert to backup!

Norv

Hello there!
Sounds good to me! I think you got it very well nailed down :)
So, you have SMF 2.0, RC1.2 already, now, if I understand correctly?

Quote from: willerby on July 24, 2009, 06:02:46 AM
Basically, at each stage I will be installing the latest versions of mods. Am I better to install the existing versions (that match my current database set up) and then upgrade or go straight to the current version? Does it make any difference?
You may be better off installing the upgraded versions of mods directly. Normally, they could know to check for previous structures of their own, and eventually use them. As far as code is concerned, though, on the contrary, I've seen every once in the while mods recommending to completely uninstall their previous version. So, you should be set off well if you install the latest versions of mods directly.

Also, about this approach: I would go a little further and delete the folders Themes and Sources, right before uploading the large upgrade. Just to be sure that .php files brought by mods and customizations to themes will be deleted. (if you have a "SPortal.php" in /Sources, for example, it would remain there in case you overwrite the folder, as only the files existing in the standard SMF package will be overwritten; not that it matters much, just for the sake of a clean install). You can also remove the two upgrade.sql files from the upgrade package, along with upgrade.php.

Quote
Plan B - revert to backup!
Cheers, this is the best part of all! By the way, it's better to make a backup of the database with phpMyAdmin, if possible at all. With structure and without extended inserts :)

As it all sounds, I'm confident you will get it sorted out very well! :)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

willerby

Good, thanks Norv, gives me a bit of confidence before starting.

Currently running SMF2.0 RC1-1 not RC1-2 : is it ok to just upload the large upgrade files or does this upgrade make changes to the database? If so, I guess I'm safe running upgrade.php? Unfortunately I can't get my version to upgrade without a manual install anyway.

Just checking out phpMyAdmin to see how to make a backup that way... export?

W

Norv

The RC1-1 to RC1.2 upgrade does not make changes to the database, so you're safe without running upgrade.php as well.

As for phpMyAdmin backups, yes, export it is :)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

willerby

Norv, worked a dream. All done in 2 hours but I did have to use upgrade.php...first set of mod installs erroring all over the place and failing to install, then one prompted upgrade of database and suddenly everything clicked.

Thanks for your help.

W

Norv

Cheers, great to hear!

Marking this topic as solved.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: