[{"data":1,"prerenderedAt":137},["ShallowReactive",2],{"content-paved-path-lift-and-shift-a-web-app-to-serverless-4-database-migration":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":9,"contributorPaths":10,"menuType":12,"contentName":13,"slug":14,"readingTime":15,"menu":16,"nextDocItem":61,"previousDocItem":48},"\u003Cp>The database is already in a MongoDB vanilla container that has all the data for this application. As MongoDB is the database engine for our stack, their recommended solution to migrate to serverless is to use \u003Ca href=\"https:\u002F\u002Faws.amazon.com\u002Fsolutions\u002Fpartners\u002Fmongodb-atlas\u002F\">MongoDB Atlas\u003C\u002Fa>. Atlas provides a database cluster in the cloud that scales automatically and you pay for what you use.\u003C\u002Fp>\n\u003Cp>To get started, we will create a new Atlas cluster and then migrate the data from the existing database to the serverless one. To migrate the data, you can first dump all the content of the database to a dump folder and then restore it to the cloud:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-sh\">mongodump --uri=&quot;mongodb:\u002F\u002F&lt;localuser&gt;:&lt;localpassword&gt;@localhost:27017&quot;\n\nmongorestore --uri=&quot;mongodb+srv:\u002F\u002F&lt;user&gt;:&lt;password&gt;@&lt;clustername&gt;.debkm.mongodb.net&quot; .\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Your data is now in the cloud. The next step is to change the configuration string in the server to point to the new database.\u003C\u002Fp>\n",{"title":6,"order":7,"youtubeVideoID":8},"Database migration",4,"Mic2TGzzVXk","The database is already in a MongoDB vanilla container that has all the data for this application. As MongoDB is the database engine for our stack, their recommended solution to migrate to serverless is to use [MongoDB Atlas](https:\u002F\u002Faws.amazon.com\u002Fsolutions\u002Fpartners\u002Fmongodb-atlas\u002F). Atlas provides a database cluster in the cloud that scales automatically and you pay for what you use.\n\nTo get started, we will create a new Atlas cluster and then migrate the data from the existing database to the serverless one. To migrate the data, you can first dump all the content of the database to a dump folder and then restore it to the cloud:\n\n```sh\nmongodump --uri=\"mongodb:\u002F\u002F\u003Clocaluser>:\u003Clocalpassword>@localhost:27017\"\n\nmongorestore --uri=\"mongodb+srv:\u002F\u002F\u003Cuser>:\u003Cpassword>@\u003Cclustername>.debkm.mongodb.net\" .\n```\n\nYour data is now in the cloud. The next step is to change the configuration string in the server to point to the new database.\n\n",[11],"content\u002Fcontributors\u002Fmarcia-villalba.json","LESSON","Lift and shift a web app to serverless","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F4-database-migration","1 min",[17,37,46,54,59,68,77,87,96,105,113,122,130],{"title":18,"content":19},"Introduction",[20],{"title":18,"order":21,"youtubeVideoID":22,"learningGoals":23,"resources":28,"time":33,"path":34,"id":35,"link":36},1,"O-hSs7aF7JE",[24,25,26,27],"Understand what lift and shift migrations are","Understand the benefits of serverless architecture","Learn how to migrate applications and databases from serverful to serverless","Learn patterns for migrating your services onto AWS.",[29],{"link":30,"text":31,"type":32},"https:\u002F\u002Fblog.marcia.dev\u002Flift-and-shift-a-web-app-to-serverless#heading-requirements-for-migration","Lift and shift to Serverless","text","2 min","1-introduction","1-introduction.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F1-introduction",{"title":38,"content":39},"Guide",[40],{"title":41,"order":42,"time":15,"path":43,"id":44,"link":45},"Requirements for migration",2,"2-requirements-for-migration","2-requirements-for-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F2-requirements-for-migration",{"title":-1,"content":47},[48],{"title":49,"order":50,"time":15,"path":51,"id":52,"link":53},"Application overview",3,"3-application-overview","3-application-overview.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F3-application-overview",{"title":-1,"content":55},[56],{"title":6,"order":7,"youtubeVideoID":8,"time":15,"path":57,"id":58,"link":14},"4-database-migration","4-database-migration.md",{"title":-1,"content":60},[61],{"title":62,"order":63,"youtubeVideoID":64,"time":33,"path":65,"id":66,"link":67},"Backend migration",5,"MvVaFPCdiZY","5-backend-migration","5-backend-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F5-backend-migration",{"title":-1,"content":69},[70],{"title":71,"order":72,"youtubeVideoID":73,"time":33,"path":74,"id":75,"link":76},"Web app migration",6,"gQn4XPfpdZE","6-webapp-migration","6-webapp-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F6-webapp-migration",{"title":-1,"content":78},[79],{"title":80,"order":81,"youtubeVideoID":82,"time":83,"path":84,"id":85,"link":86},"Authentication and authorization migration",7,"KRnZvbVT7uk","3 min","7-authentication-and-authorization-migration","7-authentication-and-authorization-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F7-authentication-and-authorization-migration",{"title":-1,"content":88},[89],{"title":90,"order":91,"youtubeVideoID":92,"time":33,"path":93,"id":94,"link":95},"Storage migration",9,"Z4frDpp4PcM","8-storage-migration","8-storage-migration.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F8-storage-migration",{"title":-1,"content":97},[98],{"title":99,"order":100,"youtubeVideoID":101,"time":15,"path":102,"id":103,"link":104},"Testing this application",11,"U_7xD-o5mCA","9-testing-this-application","9-testing-this-application.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F9-testing-this-application",{"title":-1,"content":106},[107],{"title":108,"order":109,"youtubeVideoID":101,"time":33,"path":110,"id":111,"link":112},"How much does this application cost?",12,"10-pricing-of-migrated-application","10-pricing-of-migrated-application.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F10-pricing-of-migrated-application",{"title":-1,"content":114},[115],{"title":116,"order":117,"youtubeVideoID":118,"time":83,"path":119,"id":120,"link":121},"Performance analysis",13,"B0pDPSQcAf4","11-performance-analysis","11-performance-analysis.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F11-performance-analysis",{"title":-1,"content":123},[124],{"title":125,"order":126,"time":15,"path":127,"id":128,"link":129},"Conclusion",14,"12-conclusion","12-conclusion.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F12-conclusion",{"title":-1,"content":131},[132],{"title":133,"order":117,"time":15,"path":134,"id":135,"link":136},"Extra resources","13-extra-resources","13-extra-resources.md","\u002Fcontent\u002Fpaved-path\u002Flift-and-shift-a-web-app-to-serverless\u002F13-extra-resources",1792665265240]