Upgrading from Booki1.4 to Booktype 1.5
  • Hello Everyone -


    The booktype installation instructions at github tell you how to install
    a new booktype instance but I was unclear about how to upgrade from
    booki to booktype.
     It looks to me that an upgrade is similar to an installation except that
    we would copy the current settings.py file from the existing booki directory to
    the new booktype one (at step 5) and that there is no need to create a super user
    account (step 9). 
    I would appreciate feedback on the viability of this approach. And, if this would blow up an existing booki installation, please tell me that, too.


    I've installed Booki 1.4 on my computer and tomorrow night I plan to
    upgrade that installation to Booktype 1.5.2 using the instructions
    listed below.


    Thanks for the help,

    Mark


    Instructions for upgrading from Booki to Booktype

    1. Clone Booktype


       git clone https://github.com/sourcefabric/Booktype.git




    2. Change dir to 'Booktype/scripts'


       cd Booktype/scripts




    3. Create booktype instance. If you have write permissions, script will create directory /var/www/mybooktype/. If you don't


       have write permissions, administrator should create that directory first.


          sudo mkdir /var/www/mybooktype/


          sudo chown www-data:www-data /var/www/mybooktype/




       ./createbooki --database postgresql_psycopg2 /var/www/mybooktype/ 




    4. Change directory


       cd /var/www/mybooktype/




    5. Copy the old settings.py file from the original "booki" folder into the new mybooktype folder.


       Update the settings.py file as per instructions in "How to migrate to Booktype 1.5.2"


       vi settings.py




    6. Load environment variables


       . ./booki.env




    7. Initialize database


       django-admin.py syncdb --noinput




    8. Migrate


       django-admin.py migrate




    9. NOT NEEDED Create superuser account


       django-admin.py createsuperuser




    10. Add common dokumentation licenses


       django-admin.py loaddata documentation_licenses




    11. Start redis (If you are using the distro's Redis server, this may


    not be necessary or desirable).


       redis-server &




    12. Start the whole thing


       django-admin.py runserver

  • 3 Comments sorted by
  • Hi Mark,

    when doing upgrade there is no need for the same steps as in install process. You already have working database filled with existing user and book data. Steps also depends of how long do you want to be offline during the upgrade process. Anyhoo, here is a list of steps you can do (you will be longer offline):

     - backup database and settings.py file [important step]
     - clone Booktype source from git repository [i assume this will end up in "Booktype" directory]
     - stop apache 
     - i assume Booki is in "Booki" directory. Rename it to "_Booki" and make soft link where you point "Booki" to "Booktype". No need for this but it can save you at this point from changing path variables in settings.py, shell scripts, apache configuration and cron jobs.
     - copy cron_backup.sh and cron_reports.sh scripts from _Booki/scripts/ to Booktype/scripts/
     - check the INSTALL file what changes you need to do in settings.py file
     - load environment variables with "source booki.env"
     - do database migration with "django-admin.py migrate"
     - start apache

    Be aware you should be root only when you stop/start apache. In your case, for everything else you should be "www-data" user. To connect to the database you should use config data from settings.py file.
  • Hello Aleksandar - This is what I was looking for - thanks for the feedback. I will follow them tonight and let you know how it goes.

    Mark
  • Hi Aleksander - I've successfully updated booki to booktype following your instructions. Many thanks for posting them. 

    I have one addition to the upgrade instructions. The settings.py file must be updated with the cover image upload directory.

    # book cover images  
    COVER_IMAGE_UPLOAD_DIR = 'cover_images/'

    Mark