Setting up FishEye in EC2
Asked by Andrew McKay:

I am in the process of migrating off of OnDemand FishEye and onto EC2 using the Atlassian AMI (running Ubuntu).

I have backed-up up my FishEye and Crucible data and copied to my new EC2 instance, but when trying to import the data using fisheyectl.sh command:
>
> ```
> ./fisheyectl.sh restore -f /sw/FeCru-backup-foo.zip
> ```
>
I get the following:

```
INFO  - Using log4j configuration file: /sw/fecru-2.9.1/log4j-client.xmlINFO  - FishEye arguments: [-f, /sw/FeCru-backup-foo.zip]Starting Spring Context...config.xml not found in archive.java.io.FileNotFoundException: config.xml not found in archive.	at com.cenqua.fisheye.ctl.RestoreConfig.getConfigFromBackup(RestoreConfig.java:85)	at com.cenqua.fisheye.ctl.Restore.run(Restore.java:153)	at com.cenqua.fisheye.ctl.Restore.main(Restore.java:267)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:601)	at com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:98)	at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:41)Restore failed - no config.xml was found in the file backup file specified /sw/FeCru-backup-foo.zip
```

The config.xml file is located in the backup zip file, so I am puzzled as to the cause of this issue...


Answers:
author: Piotr Swiecicki
body: Which version of FishEye are you restoring backup to? Older versions of FishEye couldn't cope with folders entries inside zip file, but since 2.10 release I think those should work fine.

If that's the issue you can either try using newer FishEye or try avoiding repackaging the whole backup file. Just update the config.xml file required and update zip with this file only, using following commands:

```
# extract single config.xml file from a backupunzip backup.zip config/config.xml# edit config.xml with your preferred editor now, make necessary changesvim config/config.xml# update backup.zip with amended config.xmlzip -u backup.zip config/config.xml
```

you may want to make a backup of your backup file first :D

comments: author: Andrew McKay
body: Repackaging the single file worked but I got a lot of import errors. I upgraded the version of Fisheye to 3.1.3 and that took care of the import issues. Thanks Piotr!


author: Piotr Swiecicki
body: Andrew,

Glad to hear the advice given worked.

Just to get you right, what exactly import errors did you have and how did you fix them? Was it sufficient to update path to the svn binary or was any more work required?

Cheers,


author: Andrew McKay
body: Prior to upgrading to Fisheye version 3x the import would never complete and I would receive messages like this:

```
INFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - Application context succesfully clINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - UnpublishINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - Closing org.springframework.osgi.context.support.OINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - Destroying singletons in orINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - Cancelling TimerINFO: command not foundfoo@system:sw/fecru-2.9.1/bin$ INFO  - *** appliINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$ INFO  - Destroying singletons in org.springframework.beans.factoryINFO: command not foundfoo@system:/sw/fecru-2.9.1/bin$
```

Upgrading the version of fisheye resolved all these messages and I was able to import successfully. I also had another issue where the user running fisheye did not have sufficient rights to the postgres database. Once this was taken care of Fisheye ran without issue.


author: Andrew McKay
body: Yes, there is a file inside the zip named config/config.xml and I've validated that the XML is well formed.

After some testing I've found that taking the backup directly from the backup manager and running fisheyectl.sh restore works and I do not receive the "config.xml not found in archive" error.

Previously I had been extracting the zip file on my local machine and modifying config.xml to point to my new svn location, per the instructions:

https://go-dvcs.atlassian.com/display/aod/migrate

It appears that its just the extracting and zipping of the backup file before running the restore that causes this issue. I've tested the zip process on both mac and windows without editing any files from the backup and it fails every time when running the restore.

My concern now is that the config.xml file that I am restoring is pointed to the wrong path for svn on my EC2 instance.


author: Nick
body: Can you please confirm that the config.xml is located in a directory called: config inside the zip.

e.g. config/config.xml .

Also, do you get the same error when trying to run the restore locally, away from EC2 ?

And just an FYI: the config/config.xml element is the first element read from the zip. Since this is failing it is likely that the backup.zip you've provided is invalid or not complete.