sdk-for-cli icon indicating copy to clipboard operation
sdk-for-cli copied to clipboard

Feature Request:- cloning of projects, databases and collections

Open roo12312 opened this issue 3 years ago • 1 comments

Adding more user/developer-friendly functions like cloning would be helpful

The current approach for cloning a project is is

  1. init the database
  2. init the collection
  3. create a new project
  4. manually edit the project id and project name inside appwrite.json to the new project
  5. deploy the collection

which a beginner developer might feel overhead..

what I suggest is a simple clone feature which can clone projects, databases and collections... This can be implemented as

appwrite clone --projectId myProject --cloneProjectId myProjectClone --cloneProjectName MyprojectClone

roo12312 avatar Jul 06 '22 23:07 roo12312

Love this, I was just running into this myself! I like creating projectId same as projectName most of the time.

My expecation of running appwrite deploy collection would offer to create project, then offer to create db as well.

{
    "projectId": "dubstep-stack",
    "projectName": "dubstep-stack",
    "collections": [
        {
            "$id": "notes",
            "$createdAt": "2022-10-14T11:24:26.880+00:00",
            "$updatedAt": "2022-10-14T11:24:39.876+00:00",
            "$permissions": [],
            "databaseId": "dubstep-stack-db",
            "name": "notes",
            "enabled": true,
            "documentSecurity": true,
            "attributes": [
                {
                    "key": "title",
                    "type": "string",
                    "status": "available",
                    "required": true,
                    "array": false,
                    "size": 255,
                    "default": null
                },
                {
                    "key": "body",
                    "type": "string",
                    "status": "available",
                    "required": false,
                    "array": false,
                    "size": 65535,
                    "default": null
                },
                {
                    "key": "profile_id",
                    "type": "string",
                    "status": "available",
                    "required": true,
                    "array": false,
                    "size": 16,
                    "default": null
                }
            ],
            "indexes": []
        }
    ]
}

codercatdev avatar Oct 17 '22 21:10 codercatdev