[{"data":1,"prerenderedAt":400},["ShallowReactive",2],{"docs:navigation":3,"docs:page:\u002Fdocs\u002Fdeployment\u002Fswitch-hosts":115},[4],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Introduction","\u002Fdocs","docs\u002F1.index",[9,11,16,21,38,95,110],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-house",{"title":12,"path":13,"stem":14,"icon":15},"Quickstart","\u002Fdocs\u002Fquickstart","docs\u002F2.quickstart","i-lucide-rocket",{"title":17,"path":18,"stem":19,"icon":20},"Essentials","\u002Fdocs\u002Fconfiguration","docs\u002F3.configuration","i-lucide-book-open",{"title":22,"path":23,"stem":24,"children":25,"icon":27},"Authentication","\u002Fdocs\u002Fauthentication","docs\u002F4.authentication\u002Findex",[26,28,33],{"title":22,"path":23,"stem":24,"icon":27},"i-lucide-shield-check",{"title":29,"path":30,"stem":31,"icon":32},"Protect User Data","\u002Fdocs\u002Fauthentication\u002Fuser-data","docs\u002F4.authentication\u002F1.user-data","i-lucide-user-lock",{"title":34,"path":35,"stem":36,"icon":37},"Two-Factor Verification","\u002Fdocs\u002Fauthentication\u002Ftwo-factor","docs\u002F4.authentication\u002F2.two-factor","i-lucide-key-round",{"title":39,"path":40,"stem":41,"children":42,"icon":44},"Deployment","\u002Fdocs\u002Fdeployment","docs\u002F5.deployment\u002Findex",[43,45,50,55,60,65,70,75,80,85,90],{"title":39,"path":40,"stem":41,"icon":44},"i-lucide-cloud-upload",{"title":46,"path":47,"stem":48,"icon":49},"Deploy to Cloudflare","\u002Fdocs\u002Fdeployment\u002Fcloudflare","docs\u002F5.deployment\u002F1.cloudflare","i-simple-icons-cloudflare",{"title":51,"path":52,"stem":53,"icon":54},"Platform Support","\u002Fdocs\u002Fdeployment\u002Fsupport","docs\u002F5.deployment\u002F10.support","i-lucide-list-checks",{"title":56,"path":57,"stem":58,"icon":59},"Deploy to Vercel","\u002Fdocs\u002Fdeployment\u002Fvercel","docs\u002F5.deployment\u002F2.vercel","i-simple-icons-vercel",{"title":61,"path":62,"stem":63,"icon":64},"Deploy to Azure","\u002Fdocs\u002Fdeployment\u002Fazure","docs\u002F5.deployment\u002F3.azure","i-simple-icons-microsoftazure",{"title":66,"path":67,"stem":68,"icon":69},"Switch Hosts","\u002Fdocs\u002Fdeployment\u002Fswitch-hosts","docs\u002F5.deployment\u002F4.switch-hosts","i-lucide-arrow-right-left",{"title":71,"path":72,"stem":73,"icon":74},"Database and File Storage","\u002Fdocs\u002Fdeployment\u002Fdata-services","docs\u002F5.deployment\u002F5.data-services","i-lucide-database",{"title":76,"path":77,"stem":78,"icon":79},"Domains and Secrets","\u002Fdocs\u002Fdeployment\u002Fsettings","docs\u002F5.deployment\u002F6.settings","i-lucide-settings",{"title":81,"path":82,"stem":83,"icon":84},"Troubleshoot Deployment","\u002Fdocs\u002Fdeployment\u002Ftroubleshooting","docs\u002F5.deployment\u002F7.troubleshooting","i-lucide-wrench",{"title":86,"path":87,"stem":88,"icon":89},"Deploy Agents","\u002Fdocs\u002Fdeployment\u002Fagents","docs\u002F5.deployment\u002F8.agents","i-lucide-bot",{"title":91,"path":92,"stem":93,"icon":94},"Deploy Automations","\u002Fdocs\u002Fdeployment\u002Fautomations","docs\u002F5.deployment\u002F9.automations","i-lucide-workflow",{"title":96,"path":97,"stem":98,"children":99,"icon":101},"Connect Accounts","\u002Fdocs\u002Fconnect","docs\u002F6.connect\u002Findex",[100,102,106],{"title":96,"path":97,"stem":98,"icon":101},"i-lucide-plug",{"title":103,"path":104,"stem":105,"icon":37},"Connection Credentials","\u002Fdocs\u002Fconnect\u002Fcredentials","docs\u002F6.connect\u002F1.credentials",{"title":107,"path":108,"stem":109,"icon":84},"Connect MCP Servers","\u002Fdocs\u002Fconnect\u002Fmcp","docs\u002F6.connect\u002F2.mcp",{"title":111,"path":112,"stem":113,"icon":114},"Project Reference","\u002Fdocs\u002Freference","docs\u002F7.reference","i-lucide-terminal",{"page":116,"surround":395},{"id":117,"title":66,"body":118,"description":388,"extension":389,"links":390,"meta":391,"navigation":392,"path":67,"seo":393,"stem":68,"__hash__":394},"docs\u002Fdocs\u002F5.deployment\u002F4.switch-hosts.md",{"type":119,"value":120,"toc":381},"minimark",[121,125,133,138,141,192,211,223,239,243,246,275,286,307,310,316,320,323,336,339,343,351,354,358,364,367,377],[122,123,124],"p",{},"You can move an app from Cloudflare to Vercel or Azure without moving its data\nat the same time. Both hosts can use the same D1 database and R2 bucket while\nyou validate the new deployment.",[122,126,127,128,132],{},"This guide assumes you already have a working deployment. Pin the database\nprovider before changing ",[129,130,131],"code",{},"deploy.target",": the default is Turso on Vercel and D1\non Cloudflare and Azure. Copying data to a different database or bucket is a\nseparate migration.",[134,135,137],"h2",{"id":136},"_1-keep-the-data-configuration","1. Keep the Data Configuration",[122,139,140],{},"For an existing D1 database, set the provider explicitly:",[142,143,149],"pre",{"className":144,"code":145,"filename":146,"language":147,"meta":148,"style":148},"language-ts shiki shiki-themes github-light github-light github-dark","db: {\n  remote: { provider: 'd1' },\n},\n","cloud.config.ts","ts","",[129,150,151,164,186],{"__ignoreMap":148},[152,153,156,160],"span",{"class":154,"line":155},"line",1,[152,157,159],{"class":158},"snPdu","db",[152,161,163],{"class":162},"sxrX7",": {\n",[152,165,167,170,173,176,179,183],{"class":154,"line":166},2,[152,168,169],{"class":158},"  remote",[152,171,172],{"class":162},": { ",[152,174,175],{"class":158},"provider",[152,177,178],{"class":162},": ",[152,180,182],{"class":181},"sIIMD","'d1'",[152,184,185],{"class":162}," },\n",[152,187,189],{"class":154,"line":188},3,[152,190,191],{"class":162},"},\n",[122,193,194,195,198,199,202,203,206,207,210],{},"For Turso, use ",[129,196,197],{},"provider: 'turso'"," and keep ",[129,200,201],{},"TURSO_DATABASE_URL"," and\n",[129,204,205],{},"TURSO_AUTH_TOKEN",". Existing explicit ",[129,208,209],{},"provider: 'libsql'"," configurations also\nretain their database and credential names on every host.",[122,212,213,214,217,218,222],{},"Keep ",[129,215,216],{},"wrangler.jsonc",", its D1 database ID, and the existing migrations. Prepare\nthe ",[219,220,221],"a",{"href":72},"D1 and R2 credentials"," required outside\nCloudflare. An expiring Wrangler login is not a runtime credential for another\nhost.",[122,224,225,226,229,230,233,234,238],{},"Current Nuxt projects use the configured database automatically. For an older\nstandalone or Next.js mount that explicitly calls ",[129,227,228],{},"sqliteFile()"," or ",[129,231,232],{},"d1()",",\n",[219,235,237],{"href":236},"\u002Fdocs\u002Fdeployment\u002Fdata-services#update-an-older-mount","update the mount"," first.",[134,240,242],{"id":241},"_2-change-the-application-host","2. Change the Application Host",[122,244,245],{},"For example, change the host to Vercel in your existing config:",[142,247,249],{"className":144,"code":248,"filename":146,"language":147,"meta":148,"style":148},"deploy: {\n  target: 'vercel',\n}\n",[129,250,251,258,270],{"__ignoreMap":148},[152,252,253,256],{"class":154,"line":155},[152,254,255],{"class":158},"deploy",[152,257,163],{"class":162},[152,259,260,263,265,268],{"class":154,"line":166},[152,261,262],{"class":158},"  target",[152,264,178],{"class":162},[152,266,267],{"class":181},"'vercel'",[152,269,233],{"class":162},[152,271,272],{"class":154,"line":188},[152,273,274],{"class":162},"}\n",[122,276,277,278,281,282,285],{},"Complete the account setup for ",[219,279,280],{"href":57},"Vercel"," or\n",[219,283,284],{"href":62},"Azure",", then deploy:",[142,287,291],{"className":288,"code":289,"language":290,"meta":148,"style":148},"language-bash shiki shiki-themes github-light github-light github-dark","pnpm exec cloudconfig deploy\n","bash",[129,292,293],{"__ignoreMap":148},[152,294,295,298,301,304],{"class":154,"line":155},[152,296,297],{"class":158},"pnpm",[152,299,300],{"class":181}," exec",[152,302,303],{"class":181}," cloudconfig",[152,305,306],{"class":181}," deploy\n",[122,308,309],{},"You do not need to initialize the project again. Deployment leaves the previous\nhost running and preserves the configured database and file storage.",[122,311,312,313,315],{},"Nuxt agent hosts use each destination's native durable runtime. Drain or retain\nexisting executions and recreate schedules before moving traffic; changing the\nhost does not copy execution history. See ",[219,314,86],{"href":87},".\nCloudflare Workflow classes remain specific to Cloudflare. Azure-native\napplication database and upload adapters are separate from the Storage account\nused by Azure Durable Functions.",[134,317,319],{"id":318},"_3-verify-the-same-data","3. Verify the Same Data",[122,321,322],{},"Before changing DNS:",[324,325,326,330,333],"ol",{},[327,328,329],"li",{},"Open the new URL and confirm existing records and files are present.",[327,331,332],{},"Create a test record on the new host and read it through the previous host.",[327,334,335],{},"Test sign-in, private data access, and file uploads if your app uses them.",[122,337,338],{},"These checks verify runtime credentials as well as the uploaded application.",[134,340,342],{"id":341},"_4-move-traffic","4. Move Traffic",[122,344,345,346,350],{},"Set ",[219,347,349],{"href":348},"\u002Fdocs\u002Fdeployment\u002Fsettings#set-the-sign-in-origin","the production origin and OAuth callbacks",",\nthen move your domain. Keep Turnstile's allowed domains current if you use it;\nTurnstile remains a Cloudflare service on every host.",[122,352,353],{},"Retain the previous deployment while validating production traffic. Remove old\nhosting resources after completing the cutover.",[134,355,357],{"id":356},"return-to-the-previous-host","Return to the Previous Host",[122,359,360,361,363],{},"Change ",[129,362,131],{}," back and deploy again. This rebuilds the application for\nthat host, but does not reverse SQL migrations.",[122,365,366],{},"Keep schema changes compatible with both application versions during the\ntransition. An older application may not work against an incompatible new schema.",[122,368,369,370,229,373,376],{},"When you are ready to move the data too, provision the destination, export and\nimport records and files, verify their contents, and plan any write freeze or\nsynchronization. Changing ",[129,371,372],{},"db.remote",[129,374,375],{},"storage.provider"," never copies data\nfor you.",[378,379,380],"style",{},"html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":148,"searchDepth":166,"depth":166,"links":382},[383,384,385,386,387],{"id":136,"depth":166,"text":137},{"id":241,"depth":166,"text":242},{"id":318,"depth":166,"text":319},{"id":341,"depth":166,"text":342},{"id":356,"depth":166,"text":357},"Move the application first while keeping the same production database and files.","md",null,{},{"icon":69},{"title":66,"description":388},"AoE7Q1FgyMPYWdIvYwwjDW1Vplx9ry7EfoT4hexdzg0",[396,398],{"title":61,"path":62,"stem":63,"description":397,"icon":64},"Publish a locally built application to a Linux App Service running Node.js 22.",{"title":71,"path":72,"stem":73,"description":399,"icon":74},"Configure production data services independently of the application host.",1792122403883]