Upgrade Stash 2.5.0 to latest version

I'm currently working on the most outdated Stash version and i really wish to migrate to the last one (v 3.1.3).

I try to install the Backup Client but i can't see it from plugin manager inside Stash. After I try this, I read on the docs that it is supported only from v2.8.

I have two tasks to perform:

* first, I need to do backup for the current situation;

* second, I really have the need to move to the latest version.

I am very unsure what it is the best flow of action due to my environment.

It is best to reinstall the new Stash and reimport every repositories in the new one?

Or a manual backup (with stash home dir and sql server stash db instance) is a better way to approach?

Thank you for your time.

4 answers

1 accepted

Hi Samuele,

The latter option (manual backup) is the way to go. To backup a version of Stash prior to v2.8, you'll need to shut down Stash and make a backup copy of the STASH_HOME directory and your external database. You can then install the new version of Stash to a new directory, point the setenv.sh or setenv.bat file at your existing STASH_HOME directory and then start Stash.

Stash will perform all of the necessary upgrades to your data on startup for you. If you need to rollback for some reason, you can simply re-instate your backup copies of STASH_HOME and the DB and start your old version of Stash again.

cheers,

Tim

Thank for your help, Tim.

I'm going to try what you suggest, but I have another question.

Just for being sure everything will go fine until the end, I have installed on a different server a new Stash 3.1.3 with an evaluation license. I'll follow your suggestion for moving out all the repositories.

Do you think I need some additional steps to go through this?

Hi Samuele,

There's no good way to "merge" two Stash instances, so I'd avoid having people use the new instance you've stood up until you've migrated over from the old one.

If you're migrating to a new server you can simply:

  1. shut down both the new and old versions of Stash
  2. make a backup copy of your STASH_HOME and database (as discussed in my previous answer)
  3. copy your old STASH_HOME directory over to the new server
  4. update setenv.sh or setenv.bat of the new instance of Stash to point to the STASH_HOME directory you copied over
  5. if you're using a new database server, you'll need to:
    1. restore a backup of your old database to the new server
    2. update the database details in your stash-config.properties (in the STASH_HOME you copied over) to point to the new database
  6. if you're happy to use your existing database server, you just need to ensure that the new server is still able to access your database. You can check the connection settings in your stash-config.properties
  7. start the new version of Stash

cheers,

Tim

Hi All,

I am trying to stash migration of 2.5.1 to 3.4.1 on a new server.

This did not work for me, I am getting an Spring Mvc problem without anything displaying in the log file. And it is not a permission problem I make sure I assigned the chown -R atlstash:atlstash in my 2.5.1 repo.

I then tried the following but having issue with:

1. in server 2.5.1:

  • save my old mysql db in a dump file
  • save the full stash home directory in a zip file

2. in server 3.4.1:

  • upload my dump file in the new db
  • install stash and try to point to that db
    This steps does not work.

    iled to obtain snapshot. Database type: postgresql; nested exception is liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: permission denied for relation app_property
    	com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseSession.getSnapshot(DefaultLiquibaseSession.java:132)
    	com.atlassian.stash.internal.backup.liquibase.LiquibaseMigrationTarget.hasNoClashingTables(LiquibaseMigrationTarget.java:57)
    	com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:49)
    	...
    org.postgresql.util.PSQLException: ERROR: permission denied for relation app_property
    	liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:251)
    	liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69)
    	com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseSession.getSnapshot(DefaultLiquibaseSession.java:130)
    	...
    ERROR: permission denied for relation app_property
    	org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    	org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    	org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    	...

 

 

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

29,068 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you