Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration guide #2591

Closed
2 tasks done
cstamatopoulos opened this issue Dec 18, 2020 · 7 comments · Fixed by #2964
Closed
2 tasks done

Add migration guide #2591

cstamatopoulos opened this issue Dec 18, 2020 · 7 comments · Fixed by #2964
Labels
documentation Documentation should be updated

Comments

@cstamatopoulos
Copy link

My actions before raising this issue

Current Behavior

There is no migration guide and no information how to migrate CVAT data in installation/FAQ guide.

Possible Solution

Update FAQ.

Steps to Reproduce (for bugs)

N/A

Context

N/A

Your Environment

N/A

Next steps

N/A
Already asked in gitter but have not received an answer.

@cstamatopoulos
Copy link
Author

cstamatopoulos commented Dec 18, 2020

I think this is the way to do it but I am not sure if that is all the files required to migrate CVAT to another host

mkdir ~/backup
docker run --rm --name temp_backup --volumes-from cvat_db -v ~/backup:/backup ubuntu tar -cjvf /backup/cvat_db.tar.bz2 /var/lib/postgresql/data
docker run --rm --name temp_backup --volumes-from cvat -v ~/backup:/backup ubuntu tar -cjvf /backup/cvat_data.tar.bz2 /home/django/data

and to restore

docker run --rm --name temp_backup --volumes-from cvat_db -v ~/backup:/backup ubuntu bash -c "cd /var/lib/postgresql/data && tar -xvf /backup/cvat_db.tar.bz2 --strip 4"
docker run --rm --name temp_backup --volumes-from cvat -v ~/backup:/backup ubuntu bash -c "cd /home/django/data && tar -xvf /backup/cvat_db.tar.bz2 --strip 3"

@azhavoro azhavoro added the documentation Documentation should be updated label Dec 18, 2020
@smallbee3
Copy link

@cstamatopoulos

Thanks for the solution!

But it seems there is a typo in your to restore command

/backup/cvat_db.tar.bz2 -> /backup/cvat_data.tar.bz2



and to restore

docker run --rm --name temp_backup --volumes-from cvat_db -v ~/backup:/backup ubuntu bash -c "cd /var/lib/postgresql/data && tar -xvf /backup/cvat_db.tar.bz2 --strip 4"
docker run --rm --name temp_backup --volumes-from cvat -v ~/backup:/backup ubuntu bash -c "cd /home/django/data && tar -xvf /backup/cvat_data.tar.bz2 --strip 3"

@pedrofrodenas
Copy link

You cannot restore postgress db copying data from volume, when docker-compose is run the database keeps restarting again and again.

In order to backup the cvat postgress database, you nned to execute the following command with the cvat_db container running.
This command saves the db data to file dump.sql in current working directory.

docker exec -i cvat_db /bin/bash -c "pg_dump --username root --clean cvat" > dump.sql

To restore in another machine, start docker-compose and run

docker exec -i cvat_db /bin/bash -c "psql --username root cvat" < dump.sql

@malfonsoNeoris
Copy link

malfonsoNeoris commented Apr 4, 2022

hi! HELP! needed here..
i executed this
docker exec -i cvat_db /bin/bash -c "psql --username root cvat" < dump.sql
and now everythin is broken!

Its working again... just deleted the cvat_db recreateed and execute this command.. NOT executing the previos unzip of data

@nmanovic
Copy link
Contributor

nmanovic commented Apr 4, 2022

@malfonsoNeoris , try to run docker exec python3 manage.py migrate. I hope it will help.

@didnmj
Copy link

didnmj commented Aug 16, 2022

@nmanovic Can I move and use the data that is backed up to another computer after I back it up from my current computer?

@nmanovic
Copy link
Contributor

@didnmj , you can but you need to be sure that you are using the same CVAT version. Only after that upgrade CVAT instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be updated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants