Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

How We Upgraded Slashcode.com

posted by Krow on 01:20 PM March 12th, 2001   Printer-friendly   Email story
So, what follows is a list of stuff I did to upgrade slashcode.com to bender. Its not incredibly pretty, but it worked.

The first thing we did was create a site called bender.slashcode.com with the install tool. The next thing was to correct our own info on the original site. In one case Cliff had an author name that was different from his user name, I corrected that. I also removed everyone who was in the author table that did not actually have any stories posted (this wasn't completly needed, but it allowed me to do some cleanup). Next, I did this to make a copy of our data:

mysqldump -u slash -p slash > datadump.sql
Now, I created an additional DBIx virtual user on our DB box just for converting tables. I dumped the data in that database using:
mysql -u -p slash < datadump.sql
Then, I ran the script down in utils called convertDBfrommain2bender.pl with the correct virtual user for the table. Once this was done I dumped the data back out via:
mysqldump -u slash -p slash --complete-insert --no-create-info > datadump
After that I just needed to insert that data back into our slashcode.com site.

Now, while I was converting data, pudge took to editing the templates in our install to make the generic site look like slashcode. We also did a select on the blocks table and copied all of those over to the new site (we did our original install with all plugins except BunchaBlocks).

Now we had to put our old comments back into the database. Sitting in the utils directory is a script Cliff wrote called slashcode-dearchive. We used it to load our comments back into the database.

After we had tested this for a while, we changed DNS and updated the variables in the vars table, via the admin interface, to point to slashcode.com (since we were testing with bender.slashcode.com, initially). Just to warn you, these are a few things that could have tripped us up, here, but didn't, so be careful! Note that the size of a story id (SID) has changed, if you used especially long ones for your pollbooths then you will need to change those by hand (it was changed for performance reasons, FYI).

As I mentioned authors are not longer seperate from users, make sure your author and user names match up. If you moved the anonymous user to a user id (UID) different then -1 you will need to make sure the account has a security level (SECLEV) of 0 (users now have a SECLEV of 1). Also, by default the upgrade procedure assumes that UID 1 is free, if it is not you are going to have to massage your data a bit.

My guess is that if you have changed around the way your comments are displayed, or have made any other like changes which modified the look and feel of them, that Cliff's script is going to fail. Pudge lucked out with use.perl.org since when he set it up, he set it up to never archive comments. On a side note: when we move Slashdot we will be using a different comment system, the one in current use wouldn't handle Slashdot (and yes there will be a script to convert to the new comment system). Journal and LadyBug will be using the new comment system once I am finished and have committed it them.

I am sure as people start to upgrade they are going to have other insights into how they went about the upgrade and exactly what they had to do. I hope our experience is helpful for you. On a side note it took about 5 minutes for the DB convert script to convert Slashdot's own data (yes, I have tried it and it does work). Thats a lot of data, but it went fine.

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • so i used this story as a guide. i used sed to match up authors and uids. basically i had a few authors without uids, so i just sed s'/user1/name/ as there were still a few default names. then i rant the convert script, and then i fed the dump file in by hand, checking each error. in the end it worked out fine (using the latest cvs bender)....
  • Ok, well, after spending a number of days pondering when/how to upgrade my site from Slash 1.0.9 to Bender, and inspired by this article, I finally did it. It was a rather rocky experience.

    I'll say first off that I'm using FreeBSD 4.2 which has fairly regularly been updated via cvsup. FreeBSD 4.3 is coming and they decided to switch the cvs tree to 4.3 RC, and that broke my Apache/Perl libraries. I tried for a couple of hours trying to get Slash 1.0.9 to work again on 4.3, but it didn't work. I resorted to

    --

    --
    It's either on the beat or off the beat, it's that easy.
  • Sounds great, that fixes a couple issues I had thought about and some new features I wasn't aware of, I look forward to checking it out. Thanks for the response.
  • Is it just me, or is there actually no article. It seems like people have read and responded, but I see nothing but the first sentance from Krow.
  • huh? There is a huge article describing how they upgraded the site.
    --

    --
    It's either on the beat or off the beat, it's that easy.
  • Instead of names and dates you have numbers and blanks. Check it out HOF [slashcode.com].
  • You can see its genesis in the Comment code that already comes in Bender's CVS.

    Look at the 'Comments' plugin.
    --
    lottadot [lottadot.com]
  • by Anonymous Coward
    After logging off, and viewing the article with the default layout, it now appears. It did not appear under the 'light' setting, and logged in as myself. (gaudior). Maybe it's a bug?
  • It isn't difficult if you don't need to run old slashcode and Bender at the same time. If not, you can go to the directory where the new Slash.pm is installed and rename this file. If you do this, Apache mod_perl will use the old Slash.om and everything works well.
  • by Anonymous Coward
    What if I have a slash site, and don't have the luxury of having 2 machines to play with?

    I too have all the stories/comments in the database still. What steps would I change/add to convert my site to Bender? I have not really done any customizations of the Blocks or anything....

  • You can do it on the same machine. The only issue is that you can not run the old slashcode and the new slashcode on the same machine (well, never say can't with perl, it would just be very twisted).
    --

    --
    You can't grep a dead tree.
  • 1) If you never archived stories you are pretty much set.
    2) Yes.
    3) Cliff's script checks for the current value of anon coward and add back in comments based on this. You are right about the one conversion scrip t though, I will update it (and you are welcome to send in patches of course).
    --

    --
    You can't grep a dead tree.
  • This was straight out of CVS. We keep the site updated with CVS at the moment. So when it breaks with CVS... it breaks the site. Until we are a bit more cleaned up this will be the case. For the most part everything is working though.
    --

    --
    You can't grep a dead tree.
  • Reading this, I have a couple of quick questions.

    1. If my site is keeping all the stories in the database, I really don't need to run that "slashcode-dearchive" script do I?

    2. This was all done on 2 separate machines right?

    3. Looking at the ConvertDBfrommain2bender.pl script in 1.15 of Bender (?), I don't see where Anonymous coward comments, which I believe is UID -1 will be saved. Will those be saved?

    --

    --
    It's either on the beat or off the beat, it's that easy.
  • Excellent! About time something like this was posted. What version of Bender though?
    --

    --
    It's either on the beat or off the beat, it's that easy.
  • I have a question, what are the new features/new advantages of the new comment system? I thought I read a while back that comments aren't archived now, but I see there is a variable for archive delay.
  • Mainly a couple of things:
    1) They can scale. AKA you can have all of your comments in the DB and it not be much of an issue.
    2) Performance. No table locking, no look for maxcid, no storing text in with other meta data.
    3) They allow for events (more on that later).
    4) As a developer it is easier to use them with custom components. Right now comments working with polls is a hack, this does it right. Pretty much any future component we want to add can have comments.

    I am probably forgetting a few things, b
    --

    --
    You can't grep a dead tree.