Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Cloud Firestore Standard sürümü ve Cloud Firestore Enterprise sürümü için geçerlidir.
Bu sayfada, yedekteki verilerin, yedeğin kaynak veritabanasıyla aynı ada sahip bir veritabanına nasıl geri yükleneceği açıklanmaktadır.
Bu sayfayı okumadan önce Verileri yedekleme ve geri yükleme hakkında bilgi sahibi olmanız gerekir.
Yerinde geri yükleme
Yerinde geri yükleme, bir veritabanını yedekten, yedeği oluşturan kaynak veritabanına geri yüklemenize olanak tanır. Bu işlem sırasında orijinal veritabanı varlığını sürdürür. Yerinde geri yükleme, trafiği yeniden yönlendirmekten veya farklı bir ada sahip veritabanı oluşturmaktan kaçınmanıza yardımcı olur.
Geri yükleme işleminde, henüz mevcut olmayan bir hedef veritabanı kullanılmalıdır. Ancak kaynak veritabanını silip yedekten geri yükleyerek kaynak veritabanasıyla aynı ada sahip yeni bir veritabanı oluşturarak yerinde geri yükleme işlemini simüle edebilirsiniz.
Yerinde geri yükleme gerçekleştirme
Yerinde geri yükleme işlemi gerçekleştirmek için aşağıdaki adımları uygulayın:
Geri yükleme işleminde kullanılacak yedeği belirleyin.
Mevcut veritabanını silin.
Geri yükleme işlemini tamamlamak için yedeği ve silinen veritabanının veritabanı kimliğini kullanın.
Başlamadan önce
Yerinde geri yükleme işlemine başlamadan önce aşağıdaki adımları tamamlamanızı öneririz:
Silinen veritabanını kurtarmanız gerekiyorsa dışa aktarma işleminden verileri içe aktarın.
Silinen veritabanını aynı veritabanı kimliğiyle kurtarmak için çalışan geri yükleme işlemlerinin tamamlanmasını bekleyip şunları yapmanız gerekir:
Veritabanı kimliğiyle mevcut veritabanını silin ve en az 5 dakika bekleyin.
Veritabanı kimliğiyle yeni bir veritabanı oluşturun.
İçe aktarma işlemi başlatma
Veritabanınızın dizin yapılandırmasını alın ve kopyalayın. Dışa aktarma işlemleri dizin tanımlarını yakalamaz. Yerinde geri yükleme işlemini tamamladıktan sonra dizinleri yeniden oluşturmak için dizin yapılandırmasını kullanın. Veritabanınızın dizin yapılandırmasını almak için aşağıdaki komutları kullanın:
gcloud firestore indexes fields list --database=DATABASE_ID
Yerinde geri yükleme gerçekleştirme
Yerinde geri yükleme işlemi gerçekleştirmek için aşağıdaki adımları tamamlayın. Bu işlem, veritabanını sildiğiniz an ile geri yükleme işleminin tamamlandığı an arasında kapalı kalma süresi gerektirir.
Geri yükleme işlemi başladıktan sonra işlemi iptal edemezsiniz ve işlemin tamamlanmasını beklemeniz gerekir. Geri yükleme işlemi, işlemde kullanılan veritabanı kimliğini hemen kullanır.
Geri yükleme işleminde kullanılacak yedeği belirlemek için gcloud firestore backups list komutunu kullanın ve kaynak adını not edin. Kaynak adı aşağıdaki biçimi kullanır:
Veritabanını sildikten sonra veritabanı kimliğinin tekrar kullanılabilir hâle gelmesi için en az 5 dakika bekleyin. gcloud firestore databases restore komutunu kullanarak geri yükleme işlemi başlatın:
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-09-10 UTC."],[],[],null,["\u003cbr /\u003e\n\n\n|----------------------------------------------------------------------------------------|\n| *Relevant to Cloud Firestore Standard edition and Cloud Firestore Enterprise edition.* |\n\n\u003cbr /\u003e\n\nThis page describes how to restore data in a backup to a database with the same\nname as the source database of the backup.\nBefore you read this page, you should be familiar with\n[Back up and restore data](/docs/firestore/enterprise/backups).\n\nIn-place restore\n\nAn in-place restore lets you restore a database from a backup to the\nsource database that created the backup while the original database still\nexists. An in-place restore helps you avoid rerouting traffic\nor creating a database with a different name.\n| **Warning:** Once you start the in-place restore process, the original database is permanently lost, and you can't undo this operation.\n\nA restore operation must use a destination database that\ndoesn't already exist. You can, however, simulate an in-place restore by deleting\nthe source database and then restoring from a backup to a new database with the\nsame name as the source database.\n\nPerform an in-place restore\n\nTo perform an in-place restore, follow these steps:\n\n1. Identify the backup to use for the restore operation.\n2. Delete the existing database.\n3. Use the backup and the database ID of the deleted database to complete the restore operation.\n\n| **Caution:** If your app uses a Cloud Firestore in Native mode client library and your clients use an offline cache, an in-place restore might flush your writes to the restored database instead of discarding the writes. This situation can occur if the client that is connected to the deleted database goes offline and, while offline, the cache accumulates writes at the time when you perform an in-place restore.\n\nBefore you begin\n\nWe recommend completing the following steps before starting the in-place restore\nprocess:\n\n1. [Export the data](/docs/firestore/enterprise/export-import#export_data) in the database you will delete.\n\n If you need to recover the deleted database,\n [import](/docs/firestore/enterprise/export-import#import_data) the data from export operation.\n To recover the deleted database to the same database ID, you must wait until\n any running restore operations complete and then:\n 1. Delete the existing database with the database ID and wait at least 5 minutes\n 2. Create a new database with the database ID\n 3. Start an import operation\n2. Retrieve and copy the index configuration of your database. Export operations\n do not capture index definitions. Use the index configuration to re-create\n indexes after you complete the in-place restore operation. Use the following commands\n to retrieve the index configuration of your database:\n\n - Use [`gcloud firestore indexes composite list`](https://cloud.google.com/sdk/gcloud/reference/firestore/indexes/composite/list)\n to retrieve a list of composite indexes:\n\n gcloud firestore indexes composite list --database=\u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e with the ID of your database.\n - Use [`gcloud firestore indexes fields list`](https://cloud.google.com/sdk/gcloud/reference/firestore/indexes/fields/list)\n to retrieve a list of single-field (built-in) index exemptions.\n\n gcloud firestore indexes fields list --database=\u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e\n\nPerform an in-place restore\n\nComplete the following steps to perform an in-place restore operation. This process\nrequires downtime between the moment you delete the database and when the\nrestore operation completes.\n\nOnce a restore operation begins, you cannot cancel the operation and must wait\nuntil the operation completes. The restore operation immediately occupies the\ndatabase ID used in the operation.\n\n1. Use the [`gcloud firestore backups list`](https://cloud.google.com/sdk/gcloud/reference/firestore/backups/list) command to identify the backup to use\n for the restore operation and note the resource name. The resource name uses\n the following format:\n\n projects/PROJECT_ID/locations/LOCATION/backups/BACKUP_ID\n\n2. Use the `gcloud firestore databases delete` command to delete the existing\n database:\n\n gcloud firestore databases delete --database='\u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e'\n\n Replace \u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e with the database ID.\n3. Wait at least 5 minutes after you delete the database for the database ID\n to become available again. Initiate a restore operation using the\n [`gcloud firestore databases restore`](https://cloud.google.com/sdk/gcloud/reference/firestore/databases/restore)\n command:\n\n gcloud firestore databases restore \\\n --source-backup=projects/PROJECT_ID/locations/LOCATION/backups/BACKUP_ID \\\n --destination-database='\u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e'\n\n Replace \u003cvar translate=\"no\"\u003eDATABASE_ID\u003c/var\u003e with the database ID.\n\nWhat's next\n\n- [Learn more about backup schedules and restore operations](/docs/firestore/enterprise/backups)\n- [Learn about configuring point-in-time recovery (PITR)](/docs/firestore/enterprise/pitr)"]]