Hi Sam,
This is a weird situation indeed.
The migration version that comes with 1.6.5 is `1.0.45` and that is
the latest migration version that is released.
The migration `1.0.48`, which your database seems to be at
currently, has not been released and is only present on the
`develop` branch.
This branch will be released in the future as AiiDA v2.0.
Is it possible that you have checked out the `aiida-core` git
repository at some point and `pip install`ed from the repository?
That is the only explanation that I can come up with how you got the
migrations from `develop`.
To solve your situation, you have essentially two options:
1) Properly install `aiida-core==1.6.5` and revert your database.
2) Keep your migrated data and continue to work off of develop.
The latter option is probably the most straightforward but
definitely not recommended.
The `develop` branch is not guaranteed to be stable, so if you are
using AiiDA for production work, I would not use it.
Still, if you prefer this option, I added instructions at the bottom
of this email for reference.
To revert your data, you should recreate the Postgres database from
your backup and then make sure you have the correct AiiDA version
installed.
First, make sure you have the correct version of AiiDA installed:
pip uninstall aiida-core
pip install aiida-core==1.6.5
Then you need to drop and recreate the PostgreSQL database.
For this you need the database dump that you say you have created
before you migrated.
So I am assuming you have a file somewhere that is the result of a
`pg_dump` call, probably a `.psql` file.
If you don't have this file, there is nothing we can do
unfortunately, otherwise you can continue reading the instructions
below.
In restoring the database, there is nothing AiiDA specific and you
can find many resources for restoring a Postgres database online.
But I will give a rundown of it here for convenience.
Note though that if you don't have any experience with this, it may
be a bit complicated.
To drop and recreate the database you need the name of the database
and the user and password you used, which you can find by running
`verdi profile show samshepherd`.
It should show something like:
aiidadb_backend django
aiidadb_engine postgresql_psycopg2
aiidadb_host localhost
aiidadb_name aiida_dev_django
aiidadb_pass aiida_password
aiidadb_user aiida_user
Then you need to run the `psql` command as the `postgres` user.
You first will need to change to that `postgres` user
sudo su - postgres
Then you run
psql
which should show you a prompt.
Then you drop the database (
WARNING: this will delete your data,
so make sure you have a proper backup!)
DROP DATABASE aiida_dev_django;
Replace the name with the value you got from
CREATE DATABASE aiida_dev_django WITH
OWNER aiida_user;
This should create a new empty database
Then you exit the shell by typing `\q`.
Then you restore the content of the database from your backup by
running:
psql -U aiida_user -h localhost -d
aiida_dev_django -W < your_backup_file.psql
Here you replace `aiida_user` with the user name of your database
and `aiida_dev_django` with the database name.
You should be prompted for the database password, which you should
have gotten from the `verdi profile show`.
The database should now be restored.
You can check that everything is in order with `verdi status`.
I hope this will help you to restore your environment to working
order.
HTH,
SPH
To install the develop branch such that you can continue using your
already migrated data, simply do the following in your loaded
virtual environment.
Again,
this is not recommended for production work.
pip uninstall aiida-core
git clone https://github.com/aiidateam/aiida-core
cd aiida-core
pip install -e .
This will install the latest develop version in your environment.
Note that there maybe other changes that require some action before
it works.
For example, you may have to apply another migration.