Commit Graph

24 Commits

Author SHA1 Message Date
Jacob Vosmaer 2b816075dc Replace backticks with Gitlab::Popen 2014-03-03 08:40:29 +01:00
Dmitriy Zaporozhets 54e40241f6 Merge branch 'backup_uploads_symlink' into 'master'
Backup Uploads Symlink
2014-03-01 12:55:13 +00:00
Jacob Vosmaer 75f274b750 Use Gitlab::VERSION to version backups
Previous to this commit, backups were tied to the git revision (SHA1) of
the app at the time the backup:create command was invoked. If the SHA1
at the time of restore was different, the script would refuse to restore
the backup.  This commit loosens this tie so that the backup script only
complains if the value of the Gitlab::VERSION constant is different
between the time of backup and the time of restore.
2014-02-27 14:30:41 +01:00
Dmitriy Zaporozhets 0a963ee15a Merge branch 'pg_force_restore' into 'master'
Pg Force Restore
2014-02-27 12:27:30 +00:00
Jacob Vosmaer 8fe10e642a Empty the database during Postgres backup restore
The expected behavior during a GitLab backup restore is to overwrite
existing database data. This works for MySQL because the output of
mysqldump contains 'DROP TABLE IF EXISTS' statements. pg_dump on the
other hand assumes that one will restore into an empty database. When
this is not the case, during the restore with psql some of the data will
be skipped if existing data is 'in the way'. By first invoking `rake
db:schema:load` during a Postgres GitLab backup restore, we make sure
that all important data is correctly restored.
2014-02-26 18:26:31 +01:00
Jacob Vosmaer 91c70c5b1c Use gitlab_shell.path to invoke rewrite-hooks.sh
The backup restore code for repositories was assuming that gitlab-shell
is installed in /home/git/gitlab-shell. This commit changes that to use
the configuration setting from gitlab.yml that specifies the path where
gitlab-shell is installed.
2014-02-26 17:32:52 +01:00
Jacob Vosmaer a47a6f2afd Support symlinked public/uploads for backp restore
The backup restore code moves any existing uploads directory out of the
way before restoring the copy from the backup. If public/uploads was a
symlink, this move would replace the symlink. This commit avoids this
issue by first resolving any symlinks in the uploads path.
2014-02-26 17:26:48 +01:00
Jacob Vosmaer 9e6fc8b526 Report failure of DB backup commands 2014-01-23 11:19:43 +01:00
Jacob Vosmaer 36f3de4f59 Remove duplication in Backup::Manager 2013-11-06 14:02:28 +01:00
Jacob Vosmaer a540ab4290 Remove Bourne shell from backup code 2013-11-06 14:02:28 +01:00
Dmitriy Zaporozhets f9b66aecdd Revert "More escaping"
This reverts commit c46eaca912.
2013-11-05 15:35:49 +02:00
Nigel Kukard c46eaca912 More escaping
- Database name may contain characters which are not shell friendly
- Database password could contain the same
- While we at it there is no harm in escaping generated paths too
- Refactored 2-line system(command)

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2013-11-04 22:09:03 +00:00
Jacob Vosmaer cb6a86ed62 Skip rather than fail empty wikis during backup 2013-10-10 16:07:39 +02:00
Dmitriy Zaporozhets 02e859a234 move backup logic to lib. Fixed removing outdated backups 2013-08-05 12:26:33 +03:00
Dmitriy Zaporozhets 7740005b76 Merge pull request #4264 from andrewwutw/fix-postgresql-restore
Fix PostgreSQL database restoration problem (#4217)
2013-07-11 09:52:43 -07:00
andrewwutw b898372154 Fix PostgreSQL database restoration problem (#4217)
Use psql instead of pg_restore to restore SQL dump file.
2013-06-10 19:06:12 +08:00
Angus MacArthur 9c82bca5ee fixes for gitlab restore with non-standard backup and repo dirs
These fixes will allow a restore of gitlab when the backups and
repositories directories are in non-standard locations (ie sub-dirs
of gitlabhq).  Also allows the restore to be run from script
overriding the need of a user to confirm the rebuild of the
authorized_keys file.
2013-05-30 09:58:36 -04:00
Ben Bodenmiller d0b04b03b4 clarify restore 2013-05-27 04:35:54 -07:00
Axilleas Pipinellis 13dcc390cb Fix errors during backup task. Fix #3785
By default there is no public/uploads directory when no attachments
are uploaded. Prompt users to create the uploads directory during
install otherwise the backup task will fail.

Place mysqldump args in single quotes to avoid error if password
contains special characters.

Signed-off-by: Axilleas Pipinellis <axilleas@archlinux.gr>
2013-05-07 14:44:49 +03:00
Dmitriy Zaporozhets e230551940 backup/restore uploads 2013-04-10 15:41:47 +03:00
Dmitriy Zaporozhets 1d03fa2e7f Run rewrite-hooks after repos restore 2013-04-10 15:11:45 +03:00
Dmitriy Zaporozhets 6c206805ae Backup/restore wiki repos too 2013-04-05 21:20:11 +03:00
Dmitriy Zaporozhets 10902c844f move old repositories dir to one with timestamp 2013-04-05 19:48:56 +03:00
Dmitriy Zaporozhets c33d5e16fe refactor backup/restore 2013-04-05 19:01:19 +03:00