Back

How to generate a database-setup script out of a appwrite-cloud-instance?

  • 0
  • Databases
  • Tools
  • Cloud
Tomla
27 Jul, 2024, 00:26

I've written a vue.js webapp with appwrite-cloud-db (including relations) and everything works just perfectly! Now I want to release this webapp as an open source project that anyone can checkout and run locally with as much automation as possible.

Therefore I have to find a way to automate the following steps:

  1. install self-hosted appwrite locally with docker
  2. import a predefined database schema with sample data into appwrite
  3. start webserver

How to achieve step 2? If it would be just a sql-db, I would just generate an sql-import-script (create database, create table etc., insert into table ) and run this against the local database in a start script.

But how to do the automated db-import with appwrite? How can I create a local importable database export file from a appwrite cloud database? Can this be achieved only with an external lib like appwrite-utils-cli? Or is the only option to code the import manually by my own using server SDK with commands like databases.createCollection ...?

Any kind of help is greatly appreciated. Tom

TL;DR
Developers can use the Appwrite CLI to deploy a collection easily, but updating it is more complex. To automate the process of setting up a local instance of an app that uses Appwrite Cloud DB, including importing a database schema and sample data, developers can use the Appwrite CLI to create a local importable database export file. This can be achieved through commands like databases.createCollection in the server SDK or using an external library like appwrite-utils-cli.
Steven
27 Jul, 2024, 00:40

The Appwrite CLI is the easiest way to deploy a collection. updating it is a different matter, though

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