migrating qatrack+

293 views
Skip to first unread message

Flavio Nelli

unread,
Feb 24, 2015, 9:52:07 PM2/24/15
to qat...@googlegroups.com
We have been testing qatrack+ installed on a windows7(64) desktop, a Windows Desktop/Apache/PostgreSQL installation and now we are thinking on putting that on a more stable Windows Server 2012 R2 virtual machine.
The first question is which kind of installation do you thing is better on that machine? Because the windows/apache/postgre installation worked smoothly I thought on preserving this kind of deployment. I've also saw that MS is offering SQL Server 2012 Express free thus I thought also on the Windows Server/IIS/CherryPy/SQL Server option.
The second question is: how do I migrate my currently deployed/configured qatrack+ to the new server?

Thanks for your attention

Kindest regards,

Flavio (Geelong, Australia)

Randle Taylor

unread,
Feb 25, 2015, 4:26:17 PM2/25/15
to Flavio Nelli, qat...@googlegroups.com
Hi Flavio,

I don't know if I'd say one of those options was necessarily better than the other...it's more of a matter of what your group is most comfortable with!  Some people prefer to use free/open source tools as much as possible so go the Apache/PostgreSQL route, while others stick with IIS/SQL Server because that is what their IT departments are willing to support.  In terms of management tools, I'd  give the nod to SQLServer Management Studio which is pretty nice, but pgAdmin is good enough too. Frankly I can't think of a really strong argument on either side so you may just want to stick with what you already know works.  (If I had my way everyone would install on Ubuntu and use PostgreSQL...the majority of people are using Microsoft though and things work nicely there too :D)

To migrate your existing data, you need to dump your existing data to a json file:
manage.py dumpdata --natural --indent=4 -e contenttypes -e auth.Permission > data.json
Then install QATrack+ on your new server and create a fresh database.  Configure local_settings.py to point to your new database and then the following steps should load your old data;

manage.py syncdb
manage.py migrate
manage.py loaddata data.json
(do not load any of the default fixtures during setup).

Hope that helps, and please feel free to get in touch if you have any issues migrating the data...it doesn't always work on the first try for everyone!

RT


--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Flavio Nelli

unread,
Mar 5, 2015, 8:34:59 PM3/5/15
to qat...@googlegroups.com, flavio...@gmail.com
Hi Randle,

Finally the new installation was done on winserver2012/apache/postgreSQL config for having that (virtual) server isolated from big mouvements on the hospital that is centralizing all the SQL databases on a a database farm... all went as smooth as the first time, including the migration of my testing database to this final place.
Many thanks!!!



Randle Taylor

unread,
Mar 5, 2015, 9:07:10 PM3/5/15
to Flavio Nelli, qat...@googlegroups.com
Great to hear Flavio! Thanks for the update.  RT

Nick Chng

unread,
Feb 9, 2016, 5:07:11 PM2/9/16
to QATrack+, flavio...@gmail.com
Hi Randle,

I'm trying to follow the migration procedure (again) but this time as a means of backing up my database.

However, this time I'm getting a "no module named admin_views" error when I use the manage.py string.  Do you know what might be causing this?

Thanks,
Nick

p.s.  Is there a more effective way of performing a QATrack+ backup that you can suggest? Short of imaging the entire drive that is... Have you tried doing backup/recoveries within postgresql?

Nick Chng

unread,
Feb 9, 2016, 5:27:57 PM2/9/16
to QATrack+, flavio...@gmail.com
Oh, and running the pip install -r requirements/base.txt doesn't help, it says the admin_views is already installed.

That said, the pip install doesn't seem to complete properly.. there are some errors about Lapack sources not being found.  I don't know if that's relevant.

-N




On Thursday, 5 March 2015 18:07:10 UTC-8, Randle Taylor wrote:
pip_results.bmp

Randle Taylor

unread,
Feb 9, 2016, 9:46:31 PM2/9/16
to Nick Chng, QATrack+
Hi Nick,

If this is the server QATrack+ is running on then you maybe haven't activated the virtual environment before trying to dump the data?  

Either way, it's hard to decipher but that screenshot does not show that admin-views is already installed (the Requirement already installed on the next line is for colorama) so a `pip install django-admin-views==0.1.4` should work.  On Windows numpy/scipy/matplotlib/psycopg/pywinauto generally need to be installed with easy_install before running `pip install -r requirements/base.txt`.

Just dumping to json is an ok method for backups if/while your database is small, however, the most reliable thing to do in my experience is to use pg_dump to dump the entire database.  My recommendation is to always automate this process as much as possible. Since you're on windows I would likely create a batch file (or PowerShell or Python or...) script that runs every night (scheduled using Windows Task Scheduler) and dumps the database to a file.  Ideally you want to keep your backups somewhere separate from your actual server so if your server hard driver ever craps out, you won't lose your backups along with it.  If you have a network accessible drive that you can write your database dumps to that would be perfect.

There's some ideas for automated backups here: https://wiki.postgresql.org/wiki/Automated_Backup_on_Windows

Hope that helps a bit,
Randy

Nick Chng

unread,
Feb 11, 2016, 2:43:55 PM2/11/16
to QATrack+, nick...@gmail.com
I'm in the process of creating a second setup to test the functionality of the backup.  However, now I have different problems :)

It looks like matplotlib is only available as a *.whl file now.  I'm not able to install this with either easy_install or pip.

Do I need to go and try to dig up an old *.exe for matplotlib?

Thanks (again)
Nick
matplotlib.png

Randle Taylor

unread,
Feb 12, 2016, 3:53:29 PM2/12/16
to Nick Chng, QATrack+
I'm actually not sure on what the status of installing wheels on Windows is these days...I'll be going through the install procedure for all platforms before the next release, but in the meantime, you might be best off just downloading version 1.2 exe from SourceForge and using easy_install to install it.

RT

James Kerns

unread,
Feb 12, 2016, 8:39:49 PM2/12/16
to QATrack+, nick...@gmail.com
wheels is now the default install method for pip. When a .whl file is available it's used, otherwise it installs the .zip file. 

Installing wheels (both the package itself and packages in the .whl format) have never given me trouble on windows. This question is relevant: http://stackoverflow.com/questions/27885397/how-do-i-install-a-python-package-with-a-whl-file

If, for whatever reason, you're struggling to get matplotlib installed via pip, use conda. It makes installing scientific stacks uber easy. Just use ``conda`` instead of pip. 
conda install numpy

See this table for differences in syntax between pip: http://conda.pydata.org/docs/_downloads/conda-pip-virtualenv-translator.html

Conda deals with all the dependencies for you by using prebuilt packages for given OS's. As good as Gohlke's libraries are, you have to install and manage the deps yourself. With conda you can just ``conda upgrade matplotlib`` and you're set. It also has a built-in environment manager. 

If you want a one-click solution, download and install Anaconda; it includes matplotlib, numpy, scipy, etc as well as the ``conda`` scripts (all the cool kids are using it =). Otherwise use Miniconda to get the ``conda`` command and install only the libraries you need.

Happy coding!

Nick Chng

unread,
Feb 19, 2016, 8:05:10 PM2/19/16
to QATrack+, nick...@gmail.com
Thanks for the help, pip install worked fine :)

Cheers,
Nick
Reply all
Reply to author
Forward
0 new messages