Project

General

Profile

Help recover Redmine using Docker containers / Tables don't exist but they are listed...

Added by Axelle C about 1 year ago

Hello,

I am currently facing issues trying to recover my Redmine.
I used to have 2 Docker containers, one for the database and one for redmine itself:

docker run -d --restart=always --name redmine-db -e MYSQL_ROOT_PASSWORD=SECRET -e MYSQL_DATABASE=redmine mysql:5.6.27
docker run -d --restart=always --name redmine-cuckoo --link redmine-db:mysql -p 8000:3000 redmine:5.0.4

I have the 3 different backup files: one for the database, one for files and one for config:

docker run --rm --volumes-from redmine-db -v $(pwd):/backup mysql tar cvfz /backup/redmine-db.tar.gz /var/lib/mysql/redmine
docker run --rm --volumes-from redmine-cuckoo -v $(pwd):/backup redmine:3.2.1 tar cvfz\
 /backup/redmine-files.tar.gz /usr/src/redmine/files
docker run --rm --volumes-from redmine-cuckoo -v $(pwd):/backup redmine:3.2.1 tar cvfz\
 /backup/redmine-config.tar.gz /usr/src/redmine/config

I think the issue is with the database recovery. I created a new redmine-db container (as above - with mysql root password), then I copied back my redmine-db.tar.gz in the container and untarred it.

In redmine-db container, there is however something not normal. I have plenty of tables (good), but I can't access them!?

mysql> show tables;
+-------------------------------------+
| Tables_in_redmine                   |
+-------------------------------------+
| attachments                         |
| auth_sources                        |
| boards                              |
| changes                             |
| changeset_parents                   |
| changesets                          |
| changesets_issues                   |
| comments                            |
| custom_field_enumerations           |
| custom_fields                       |
| custom_fields_projects              |
| custom_fields_roles                 |
| custom_fields_trackers              |
| custom_values                       |
| documents                           |
| email_addresses                     |
| enabled_modules                     |
| enumerations                        |
| groups_users                        |
| import_items                        |
| imports                             |
| issue_categories                    |
| issue_relations                     |
| issue_statuses                      |
| issues                              |
| journal_details                     |
| journals                            |
| member_roles                        |
| members                             |
| messages                            |
| news                                |
| open_id_authentication_associations |
| open_id_authentication_nonces       |
| projects                            |
| projects_trackers                   |
| queries                             |
| queries_roles                       |
| repositories                        |
| roles                               |
| roles_managed_roles                 |
| schema_migrations                   |
...

mysql> select * from schema_migrations;
ERROR 1146 (42S02): Table 'redmine.schema_migrations' doesn't exist
mysql> select * from roles;
ERROR 1146 (42S02): Table 'redmine.roles' doesn't exist
mysql> select * from users;
ERROR 1146 (42S02): Table 'redmine.users' doesn't exist

Should I have backuped something else in redmine-db.tar.gz? Is there a way to recover nonetheless?

From this link: https://stackoverflow.com/questions/7759170/mysql-table-doesnt-exist-but-it-does-or-it-should, it looks like I should have backuped ib* files in the root of the MySQL datadir (I did not, did not know).
Is there a way to restore however? I suspect not.
If I can't recover the database, will the config and files directory contain anything interesting I can recover? I wanted to recover the contents of each tasks (label, description etc).

Thanks,