Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:28:17+00:00 2026-05-27T13:28:17+00:00

My deployment strategy looks like this (using Fabric): create a new virtualenv deploy new

  • 0

My deployment strategy looks like this (using Fabric):

  1. create a new virtualenv
  2. deploy new code in new virtualenv
  3. show a maintenance page
  4. copy the current db to new db
  5. migrate new db
  6. point new code to new db
  7. symlink current virtualenv to new venv
  8. restart services
  9. remove maintenance page

I want to iterate fast. Now, most of the code changes do not contain migrations. Also, the db is growing, so there is much overhead created by copying the database everytime I deploy a (mostly small) change. To avoid copying the database I want to check whether there are migrations that need to be deployed (prior to step 4). If there are no migrations, I can go straight from step 2 to step 7. If there are, I will follow all the steps. For this, I need to check programmatically whether there are migrations that need to be deployed. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:28:17+00:00Added an answer on May 27, 2026 at 1:28 pm

    In step 2 while deploying the new code, you could deploy a script which when run on the server will detect if there are new migrations.

    Example code is as follows:

    # copied mostly from south.management.commands.migrate
    from south import migration
    from south.models import MigrationHistory
    
    apps  = list(migration.all_migrations())
    
    applied_migrations = MigrationHistory.objects.filter(app_name__in=[app.app_label() for app in apps])
    applied_migrations = ['%s.%s' % (mi.app_name,mi.migration) for mi in applied_migrations]
    
    num_new_migrations = 0
    for app in apps:
        for migration in app:
            if migration.app_label() + "." + migration.name() not in applied_migrations:
                num_new_migrations = num_new_migrations + 1
    
    return num_new_migrations
    

    If you wrap the above code up in a script, your fabric deployment script can use the run operation to get the number of new migrations.

    If this returns zero, then you can skip the steps associated with copying the database.
      

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like deployment of VSTO code is very cumbersome. My use case is
I'd like some advice on a deployment strategy. If a development team creates an
I am creating a clickonce installer using the deployment strategy of Install from the
I'm writing a deployment engine for our code. I plan to put a deploy.py
From this item: What's best Drupal deployment strategy? .... I quote: Databases are trickier;
Our Application deployment structure is something like this: User can download the application form
We're trying to work out a deployment strategy for an internal tool that we're
We have a deployment system at my office where we can automatically deploy a
I am writing a deployment script using MSBuild. I want to clean my web
Our deployment process is that we copy the code from usb to the deployment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.