Upgrade Guide
How to safely upgrade your BookMyStay codebase to newer releases while preserving your database, images, and custom configurations.
Because all hotel bookings, branch records, room inventory, and configuration settings reside in Cloud Firestore and Storage, upgrading the application code will never delete or corrupt your live database.
Pre-Upgrade Backup
Always create a full zip archive of your project directory before applying updates, and review the Changelog for any breaking schema adjustments.
Files to Preserve#
Keep these files safe before copying the new update so your Firebase keys, signing certificates, and credentials remain intact:
| File Path | What It Contains |
|---|---|
admin_panel/lib/firebase_options.dart |
Admin Panel Firebase credentials |
customer/lib/firebase_options.dart |
Customer App Firebase credentials |
customer/android/app/google-services.json |
Android Firebase configuration |
customer/ios/Runner/GoogleService-Info.plist |
iOS Firebase configuration |
customer/android/key.properties & *.jks |
Production Android release signing keys |
functions/service-account.json |
Firebase Admin SDK credentials (if configured) |
Also keep your custom app icons, names, and package names.
Update the code#
- Commit your current project to
mainin GitHub Desktop or Git. - Create a branch named after the version, for example
v1.1.0. - Unzip the new release into a separate folder. Copy its
admin_panel/lib,customer/lib, eachpubspec.yamlandassets/,functions/(withoutnode_modules) andfirebase_setup/into your project. - Put back your own files from the table above, and commit.
- Merge the branch into
main. If there are conflicts, keep the right lines between<<<<<<<and>>>>>>>.
- Back up your existing project directory to a separate location or ZIP archive.
- Unzip the new release into a new folder.
- Copy your preserved files from the table above into their matching locations in the new folder.
- Open the new folder in VS Code or Android Studio as your working project.
Redeploy and rebuild#
Run the new setup tool
Start the new firebase_setup tool with a fresh service account key and keep the mode Only add documents that don't exist yet. It updates the rules, indexes and Cloud Functions, and adds any new starter settings without touching your data.
Refresh each app
flutter clean
flutter pub get
Run these commands inside both admin_panel/ and customer/ folders. On a Mac, also run pod install --repo-update in the customer/ios/ folder.
Redeploy Cloud Functions & Hosting
cd functions && npm install && firebase deploy --only functions
cd ..
cd admin_panel && flutter build web --release && cd ..
cd customer && flutter build web --release && cd ..
firebase deploy --only hosting