Back

using the cli to export and import schemas

  • 0
  • Databases
mauricev
31 May, 2023, 06:33

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.

TL;DR
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
31 May, 2023, 06:57

can you show screenshot of the error

mauricev
31 May, 2023, 13:04

✗ Error No collections found in the current directory. Run appwrite init collection to fetch all your collections.

Drake
31 May, 2023, 16:07

When you did appwrite init collection did you select the databases/collections you wanted to import?

mauricev
1 Jun, 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
1 Jun, 2023, 00:57

Would you please record a video? Just the init collection part

mauricev
1 Jun, 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
1 Jun, 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?

mauricev
1 Jun, 2023, 02:21

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
1 Jun, 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
1 Jun, 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
1 Jun, 2023, 02:36

did you create the project in the destination appwrite instance, yet?

mauricev
1 Jun, 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.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more