Migration guide
How to migrate an app from Firebase Studio before the shutdown

If your app still exists only inside Firebase Studio, treat the workspace as temporary. Export the source code, identify every external dependency, place the project in a repository, and prove that it can build and run elsewhere before the shutdown deadline.
This guide describes a cautious migration path for a typical web app created or edited in Firebase Studio. It does not assume a particular framework, hosting provider, project ID, or authentication setup. Commands below are examples: replace them with the commands declared by your own project files.
What you should have at the end
A migration is complete only when you can answer “yes” to all of these questions:
- The source code and required project files are stored outside Firebase Studio.
- The repository contains a documented install and build procedure.
- The app starts locally from a clean checkout.
- Authentication works using the intended test accounts and authorized domains.
- The production build completes without relying on the old workspace.
- The deployment target, environment variables, and rollback path are documented.
The last three items require testing in your own environment. This article does not claim that any particular app, provider, or command has been tested here.
Case: a small app that must leave the workspace
Consider a simple app with a frontend, a Firebase backend, sign-in, and a deployment pipeline configured in the workspace. Its source files may be easy to download, but the application can still fail after export because configuration is often split between files, environment variables, Firebase Console settings, service accounts, and provider-specific build settings.
The safe approach is to create an inventory before changing anything. Record names and locations, not secret values:
- the framework and runtime version;
- the package manager and lockfile;
- the build, test, lint, and start scripts;
- Firebase project identifiers and enabled services;
- authentication providers, authorized domains, and redirect URLs;
- database or storage rules and indexes;
- environment-variable names required by the application;
- the current deployment provider and its build settings.
Step 1: freeze a recoverable copy
Before editing or deleting anything, make an export of the workspace using the export or download option available in your Firebase Studio interface. If the interface offers a connection to a Git provider, use it only after checking which files will be committed.
Keep the first export unchanged. Name it with a date and store it in a private location controlled by your team. The copy is a recovery artifact, not yet a trustworthy source of truth.
If the workspace contains generated files, dependency directories, build output, or local caches, do not assume they belong in version control. Inspect the project structure and the existing ignore file before committing.
Step 2: inspect the exported project
From the exported project directory, identify the package manager and available scripts.
ls -la
find . -maxdepth 2 -type f | sort
sed -n '1,220p' package.json
The exact commands may differ on Windows. The important evidence is in the files themselves. Look for package.json, a lockfile such as package-lock.json, pnpm-lock.yaml, or yarn.lock, framework configuration, Firebase configuration, and deployment configuration.
Read the scripts section before running anything:
{
"scripts": {
"dev": "...",
"build": "...",
"start": "...",
"test": "...",
"lint": "..."
}
}
Do not invent a missing build command. If the project has no build script, identify the framework’s documented build command and record the decision in the repository README.
Step 3: separate configuration from secrets
Configuration tells the app where to connect. Secrets authorize access. They must be handled differently. Search for environment-variable references and suspicious hard-coded credentials, but avoid printing their values:
rg -n --hidden \
-g '!node_modules' \
-g '!dist' \
-g '!build' \
'process\.env|import\.meta\.env|AIza|PRIVATE_KEY|CLIENT_SECRET|TOKEN|PASSWORD' .
A browser Firebase configuration object can contain identifiers intended for client-side use, but that does not make every nearby value safe to publish. Treat service-account keys, private keys, access tokens, database administrator credentials, and deployment tokens as secrets.
Create a safe configuration template containing names only:
# .env.example
PUBLIC_FIREBASE_API_KEY=
PUBLIC_FIREBASE_AUTH_DOMAIN=
PUBLIC_FIREBASE_PROJECT_ID=
PUBLIC_FIREBASE_STORAGE_BUCKET=
PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
PUBLIC_FIREBASE_APP_ID=
Use the variable names your framework expects. Add the real .env file to .gitignore, and verify that it is not already tracked:
git check-ignore -v .env .env.local
git ls-files | rg '(^|/)\.env(\.|$)|service-account|credentials|secret'
If a secret was committed, removing the file is not enough. Rotate or revoke the exposed credential through the relevant provider, then remove it from the repository history using a reviewed procedure.
Step 4: create the repository
Create an empty private repository in the Git provider selected by your team. Do not initialize it with a second README or unrelated template if you already have a project directory.
From the exported project directory:
git init
git add .
git status
git commit -m "Preserve exported app before migration"
git branch -M main
git remote add origin https://example.com/OWNER/REPOSITORY.git
git push -u origin main
The remote URL above is an example, not a value to copy. Confirm the destination before pushing. Review git status and the staged file list for secrets, personal data, large generated files, and unrelated workspace metadata.
Add a README that states the runtime version, package-manager command, required environment-variable names, local start command, build command, deployment target, and known limitations. Never put secret values in the README.
Step 5: reproduce the install from a clean checkout
A migration is not reproducible if it works only in the exported directory with its existing dependency directory. Clone the repository into a new directory or use a clean machine.
git clone https://example.com/OWNER/REPOSITORY.git app-migration-check
cd app-migration-check
Install with the package manager that matches the lockfile. Examples:
npm ci
# or
pnpm install --frozen-lockfile
# or
yarn install --frozen-lockfile
If a frozen install fails, do not immediately regenerate the lockfile. First check the runtime and package-manager versions, the lockfile committed to the repository, private package access, and whether the original workspace used an undocumented dependency.
Step 6: verify the development build
Copy only the required values into a local environment file. Start the app using the script from package.json:
npm run dev
Open the local URL shown by the command. Check the primary route, browser console, network requests, static assets, and any server-side logs. Record the runtime version and the exact command that worked.
Then run the production build:
npm run build
A build that completes is useful evidence, but it does not prove that authentication, database rules, redirects, or deployment work. Keep those checks separate.
Step 7: test authentication deliberately
Authentication has at least two sides: the client configuration and the provider’s project settings. Test the same sign-in flows that real users need, using non-production test accounts where possible.
- Open the app from the local development URL.
- Attempt the supported sign-in flow.
- Confirm that the user session appears after sign-in.
- Reload the page and check whether the session is restored as intended.
- Sign out and verify that protected content is no longer available.
- Inspect the browser console and network responses for redirect or domain errors.
If sign-in fails locally, compare the local origin with the authorized domains configured for the Firebase project. For provider redirects, verify the callback URL and the application’s public URL. Do not “fix” the issue by disabling security rules or publishing credentials.
Step 8: verify Firebase services and rules
List the Firebase services the code actually uses. Common examples include Authentication, Firestore, Realtime Database, Storage, Cloud Functions, and Hosting. For each service, identify its configuration and a safe test action.
If the project uses Firestore or Realtime Database, test both an allowed operation and a deliberately denied operation with a test account. If it uses Storage, test the expected upload and download boundaries. Treat a successful request as evidence only for that specific path and account; it is not a complete security review.
Preserve rules and indexes in source control when the project supports that workflow. Review them before deployment because an export may omit console-only settings or generated metadata.
Step 9: prepare deployment outside Firebase Studio
Choose the deployment target before the workspace disappears. It may be Firebase Hosting, a Git-connected hosting provider, a container platform, or another service compatible with the framework.
Document these values in the repository without exposing secrets:
- the build command;
- the output directory;
- the runtime or Node.js version;
- required environment-variable names;
- the branch used for production;
- redirect and rewrite rules;
- the deployment command or provider workflow;
- the rollback procedure.
Configure environment variables in the deployment provider’s secret store. Deploy a preview or staging environment first. Verify the deployed URL, sign-in, protected routes, API calls, static assets, and browser console before promoting the build.
Verification checklist
Use this checklist as the acceptance record for the migration:
- Repository clone succeeds in a new directory.
- Dependency installation succeeds using the committed lockfile.
- Development server starts with documented commands.
- Production build completes from the clean checkout.
- Required environment-variable names are documented.
- No secrets or personal data are tracked by Git.
- Sign-in and sign-out work with a test account.
- Session persistence behaves as expected after reload.
- Database and storage operations follow the intended rules.
- Preview deployment loads the application correctly.
- Production deployment and rollback steps are documented.
- The repository is accessible to the people responsible for maintenance.
Save the date, commit identifier, runtime version, commands, and observed failures in a migration note. This creates an audit trail without claiming more than you verified.
Common failure cases
The export is missing files
Compare the exported directory with the workspace tree. Generated files may be excluded intentionally, while ignored source files may indicate a configuration problem. Re-export from the original workspace and inspect hidden files before deciding what to restore.
The install works only in the old workspace
Check the lockfile, runtime version, private registry settings, native dependencies, and environment variables. The workspace may have supplied tools or credentials implicitly. Make the dependency explicit or document the required setup.
The app builds but the browser shows a blank page
Inspect the browser console, network requests, output directory, base path, and client-side routing rules. A successful compiler result does not prove that the server returns the correct fallback document for every route.
Authentication fails after deployment
Compare the deployed origin with authorized domains and redirect URLs. Confirm that the deployed environment received the required public configuration and that no server-side secret was accidentally exposed to client code.
Deployment cannot find the output directory
Read the framework configuration and the actual build output. Set the provider’s output directory to the directory produced by the build, then repeat the preview deployment from a clean commit.
Limitations and scope
This guide cannot determine the exact Firebase Studio shutdown date, the contents of a specific workspace, or the settings of your Firebase project. Confirm deadline notices and product-specific instructions in the official channels available to your account. The commands are illustrative and must be matched to the project’s framework and package manager.
Exporting source code also does not automatically migrate data, billing ownership, custom domains, scheduled jobs, third-party integrations, or production credentials. Treat each of those as a separate workstream with its own owner and verification evidence.
Final handoff
Once the repository has a clean-checkout build, tested authentication, a documented deployment path, and no exposed secrets, the app is no longer dependent on the Firebase Studio workspace for continued work. Keep the original export until the new process has been exercised by the people who will maintain it.
Continue with the site’s guides or look up unfamiliar terms in the glossary.