I have a previous cnprog installation and I want to migrate to osqa.

How do I do this, I observed that there are quite a few changes to the database.

asked 20 Mar '10, 15:36

sorin's gravatar image

sorin
1.1k234447
accept rate: 11%

Gi Sorin, Hernani or I could probably help you if you wish. Just catch us in the OSQA channel.

(20 Mar '10, 17:47) rickross ♦♦

Actually, here's an option. Download and install django evolution, then upgrade your code, and add "django-evolution" to the INSTALLED_APPS setting, finaly run manage.py evolve --hint --execute. But while you do that, keep django-authopenid around and in the installed apps setting. After the database "evolution" you'll have to run a small script to convert django-authopenid associations to the new style associations. The script is not in the repo because it was in the django-authopenid folder, but I'll add it in a while and update this.

Finally you can remove django-authopenid, both the folser and from installed-apps.

Django-evolution is very safe, is being written by one of the django core developers, and is a strong candidate to be part of the django core in a near future.

link

answered 20 Mar '10, 18:01

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

that's cool I should learn how to use that.

(20 Mar '10, 20:05) Evgeny Fadeev

This looks like the right way to do it. I think we should include evolution as part of osqa project.

(21 Mar '10, 03:59) sorin

I'm srill trying to learn it myself :-) They have some things called "evolutions" that can be bundled with an application, so we can migrate data from the olds schema to the new schema, but this is not very well documented yet. We should at least bundle these "evolutions".

(21 Mar '10, 12:46) Hernani Cerq... ♦♦

I already did the migration using the trial of SQLyog - this has an option to synchronize two databases. It does create SQL scripts to update the database. Also it is able to synchronize data in addition to schema.

link

answered 21 Mar '10, 03:57

sorin's gravatar image

sorin
1.1k234447
accept rate: 11%

edited 21 Mar '10, 04:01

Have you been able to install email subscriptions? If not - run 'subscribe_everyone' job (adds weekly subscription for everyone - for different option edit up the subscribe_everyone.py file)

(21 Mar '10, 16:17) Evgeny Fadeev

You are probably in for some fun.

There are two ways: (1) write proper migration code (2) use sql scripts from sql_scripts directory.

If you choose second option then I recommend taking two steps:

  1. Migrate to some "pre-new auth" version (dated no later than Feb 28) manually (manual migrations are not as scary as they might seem - all you need it to issue some ALTER TABLE commands into the database)
  2. Go from there to the latest version using Hernani's script (he'll explain you better how to use it and where to find it)

Older sql migration scripts are in the directory sql_scripts. The files are dated, but some that start with update_2009_12_ have actually been created in 2008.

The general idea is:

  • clone the database and create a spare backup
  • install newer code
  • run syncdb - that will install any new tables, but will not repair the old ones
  • try to run the site and expect database errors
  • amend by running sql scripts or manual commands in the database until your site works
  • in the case of real bad mistake - reload the dump and repeat
  • keep log of your SQL commands in a script so that you can re-run it

Which scripts you'll want to look into - depends on the date of your CNPROG code.

Good luck!

link

answered 20 Mar '10, 17:21

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
1.0k51820
accept rate: 48%

edited 20 Mar '10, 17:40

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×156
×62
×13
×7

Asked: 20 Mar '10, 15:36

Seen: 1,565 times

Last updated: 21 Mar '10, 04:01

powered by OSQA