Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

stash-backup-client restore assistance please

Alicia Pena June 12, 2015
  1.  I implemented the stash backups using the stash-backup-client-1.4.0 many months ago.  We have since upgraded our stash to version 3.8.0 and created a brand new environment from scratch, to which I'd like to recover backups to.  I tested the recovery using 1.4.0 and it worked fine back when I implemented the backups, months ago.  However, it's not working now that I need to recover to stash 3.8.0.  I recieved this error complaining about using backup client v1.4.0 (which is strange since it still backs up with stash 3.8.0, but can't recover to 3.8.0??):
2015-06-12 10:47:55,525 ERROR [main] c.a.s.i.backup.client.RestoreMain stash-20150610-050538-924.tar could not be restored. Reason: This version of the restore client (1.4.0) lacks the necessary features to restore the backup stash-20150610-050538-924.tar of Stash 3.8.0. You must upgrade the restore client to successfully restore the backup.

       2.  So I downloaded, installed and configured your latest version 1.9.1 backup client on the new environment, but now I'm getting this error:

2015-06-12 13:06:53,351 INFO  [main] c.a.s.i.b.client.spring.SpringMain Initializing
2015-06-12 13:06:54,601 INFO  [main] c.a.s.i.b.c.DefaultRestoreClient Unpacking stash-20150610-050538-924.tar to /home/stash/stash_home
2015-06-12 13:07:48,342 INFO  [main] c.a.s.i.b.c.DefaultRestoreClient Validating database before restore
2015-06-12 13:07:49,009 ERROR [main] c.a.s.i.backup.client.RestoreMain stash-20150610-050538-924.tar could not be restored. Reason:
The target database is not configured for UTF-8 support. For information about creating a database for use with Stash, please refer to the Stash documentation.
com.atlassian.stash.internal.backup.client.RestoreException: The target database is not configured for UTF-8 support. For information about creating a database for use with Stash, please refer to the Stash documentation.
        at com.atlassian.stash.internal.backup.client.DefaultRestoreClient.validateDataSource(DefaultRestoreClient.groovy:261) ~[stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.DefaultRestoreClient.withDataSource(DefaultRestoreClient.groovy:268) ~[stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.DefaultRestoreClient.restoreDatabase(DefaultRestoreClient.groovy:220) ~[stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.DefaultRestoreClient.restoreSystem(DefaultRestoreClient.groovy:254) ~[stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.DefaultRestoreClient.restore(DefaultRestoreClient.groovy:85) ~[stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [stash-backup-core-1.9.1.jar:na]
        at com.atlassian.stash.internal.backup.client.RestoreMain.main(RestoreMain.groovy:55) [stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.JavaVersionCheckingShim.invokeClientClassMain(JavaVersionCheckingShim.java:71)
 [stash-restore-client.jar:1.9.1]
        at com.atlassian.stash.internal.backup.client.JavaVersionCheckingShim.run(JavaVersionCheckingShim.java:85) [stash-restore-client.jar:1.9.1]
        ... 69 frames suppressed

3.  By the way I've dumped and recreated by stash database several times, the same I always do:

mysql> drop database stash;
Query OK, 0 rows affected (0.00 sec)
mysql> create database stash CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on stash.* to 'stash'@'10.1.119.13' identified by '<passwd>';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit

4.  These are the configuration settings within my backup-config.properties file:

Backup Properties:

stash.home=/mnt/external/stash_home
stash.user=stash
stash.password=<passwd for the stash user with admin privs>
stash.baseURL=https://stashstag.vidder.net

 

Restore Properties:

jdbc.override=true
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://<ipaddress>:3306
jdbc.user=stash
jdbc.password=<passwd for stash database user>

Any help would be appreciated.

Best Regards,

Alicia

4 answers

2 votes
ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2015

Hi Alicia,

In regards to your questions:

Question 1:

That's expected. I just ran a test backup of a 3.8.1 release, and we do warn our customers about this situation (backup will work but restore won't – please read carefully the WARN message below):

$ java -jar stash-backup-client.jar
2015-06-15 11:26:59,949 INFO         Initializing
2015-06-15 11:27:01,366 INFO         Using Stash 3.8.1
2015-06-15 11:27:01,490 INFO         Contacting Stash
2015-06-15 11:27:01,515 WARN         The current version of the restore client (1.4.0) lacks the necessary features to restore backups for Stash 3.8.1. Backups will be performed successfully, but you must upgrade the restore client in order to restore them. To fail in this situation, please change the backup.requirerestorable property in backup-config.properties
2015-06-15 11:27:01,681 INFO         Stash has been locked for maintenance. It may be unlocked with token: 63609bd8c8c052eab1e13f24654104b33347c2dc
2015-06-15 11:27:01,852 INFO         Starting database backup on Stash. It may be cancelled with token: 62b55b32a8323fd39075975dd9b65dd80c13b4a2
2015-06-15 11:27:06,482 INFO   (50%) Verifying Stash home
2015-06-15 11:27:06,504 INFO   (50%) Verifying Stash home
2015-06-15 11:27:06,551 INFO   (50%) Backing up Stash home
2015-06-15 11:27:06,562 INFO   (50%) Waiting on Stash database backup to complete
2015-06-15 11:27:11,154 INFO  (100%) Stash has completed backing up the database
2015-06-15 11:27:11,154 INFO  (100%) Downloading database backup zip from Stash
2015-06-15 11:27:11,245 INFO  (100%) Backup complete: /Users/tbomfim/stash-backup-client-1.4.0/backups/stash-20150615-112711-244.tar
2015-06-15 11:27:11,250 INFO  (100%) Unlocking Stash using token: 63609bd8c8c052eab1e13f24654104b33347c2dc

Therefore, you can trust the backup that you have at hand and just restore with a newer version of the restore client as indicated on the message you shared with us. I am going to work on documenting this better on our Backup Client guide.

Question 2:

The cause for this is the same as the one described below:

From your description, though, you're creating the new database correctly. It should just work. Can you double check your character set encoding and collation are set correctly on your database (the KB above explains how)? Also, can you make sure you're connecting to the right server where you created this database?

Best regards,
Thiago Bomfim
Atlassian Support

1 vote
Alicia Pena June 15, 2015

Fixed!  1.  The database needed flushing since I tried with 1.4.0 before trying with 1.9.1, which caused too many connections.  2.  I forgot to add the database name in the properties file.  (although I didn't think I had to enter anything in the recovery portion of property files since import was to same database name, ip ,etc.).  But adding the database name worked:

jdbc.url=jdbc:mysql://<ipaddress>:3306/stash

Thanks,

Alicia

ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2015
0 votes
Alicia Pena June 15, 2015

Should I try downgrading my stash instance to an older version compatible with your 1.4.0 backup, import my backup using 1.4.0 and then upgrade stash instance back to 3.8.0?  My concern with this process is that the backup data came out of 3.8.0 and may not import properly to an older version.  But this seems like the only other option to try.

Alicia

0 votes
Alicia Pena June 15, 2015

Hello Thiago,

I did double check that the database was set up correctly and had utf8.  I even dropped the database and recreated it several times.  See below:

image2015-6-15 10:33:34.png

image2015-6-15 10:34:30.png

Any other suggestions?

Thanks,

Alicia

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events