I'm trying to export and import the schema between two appwrite installations via the CLI, but I'm not see what the right commands are. I can apparently "appwrite init project" and "appwrite init collection", but other than a simple json file with the name of the project, nothing else happens. "appwrite deploy collection" just tells me I have no collections in the current diretory. It seems there are missing commands here.
Summary
User is trying to export and import schemas between two Appwrite installations using the CLI. They were initially having trouble with editing the appwrite.json file, but were able to resolve it. They then encountered an issue with changing the server endpoint and project ID. The support member suggested using the endpoint option and ensuring the project ID is in the appwrite.json file. The user encountered another error when trying to deploy the collection and requested a video demonstration. The user also shared the error output and asked for further assistance. The support member asked if the user selected the databases/collections during the "appwrite init collection" command. The user confirmed they
animeyeet
Rank 2: Process
May 31, 2023, 06:57
can you show screenshot of the error
mauricev
Rank 2: Process
May 31, 2023, 13:04
✗ Error No collections found in the current directory. Run appwrite init collection to fetch all your collections.
Drake
Admin
May 31, 2023, 16:07
When you did appwrite init collection did you select the databases/collections you wanted to import?
mauricev
Rank 2: Process
Jun 1, 2023, 00:56
Yes, here's the entire output, ? How would you like to start? Link this directory to an existing Appwrite project
? Choose your Appwrite project. Alberto’s aquarium (63e8651745c7c2a0353b)
✓ Success
maurices-Mini:a maurice$ appwrite init collection
? From which database would you like to init collections?
✓ Success
maurices-Mini:a maurice$ appwrite deploy collection
✗ Error No collections found in the current directory. Run appwrite init collection to fetch all your collections.
Drake
Admin
Jun 1, 2023, 00:57
Would you please record a video? Just the init collection part
mauricev
Rank 2: Process
Jun 1, 2023, 01:00
Ah, I see the problem. There's an arrow pointing to what I want to select and I thought that that arrow meant it was selected, but when you hit spacebar, the circle fills in to really confirm the selection.
mauricev
Rank 2: Process
Jun 1, 2023, 01:04
But now when I try appwrite deploy collection, it seems to want to overwrite the existing database? How do I switch servers to import the schema?
This isn't working. It seems that you want to reset what appwrite points to, but debug output spews blanks. It then tells me ℹ Info Database 63eefc50e6d7b0cb4c4e not found. Creating it now..., but that's the project id of source server. It claimed to create but that didn't happen. When I do "appwrite init project", I get "? An Appwrite project ( ) is already associated with the current directory. Would you like to override (Y/n) ".
Drake
Admin
Jun 1, 2023, 02:23
Not reset. Use the endpoint option to change your endpoint to point to your other server and then login. You should also create the project in the Appwrite console and make sure the project id is in your appwrite.json. then, you can deploy
mauricev
Rank 2: Process
Jun 1, 2023, 02:27
I am sorry but I am not getting it. Are you saying i should edit the appwrite.json to have the project id of the destination server.? It would really help for someone to simply write up the steps on how to do this.
Drake
Admin
Jun 1, 2023, 02:36
did you create the project in the destination appwrite instance, yet?
mauricev
Rank 2: Process
Jun 1, 2023, 02:37
I got it. It worked. I needed to manually enter in the project name and id into the appwrite json that came from the other server. Thank you.