| 
									
										
										
										
											2022-03-01 11:03:51 +00:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Upgrade | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  | # Upgrading | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | **Warning**: When performing database migrations, you may lose data if the migration is not done properly. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1. Pull the current version: | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```sh | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    git pull | 
					
						
							|  |  |  |    ``` | 
					
						
							|  |  |  | 2. Apply database migrations by running <b>one of</b> the following commands: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    In a development environment, run: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```sh | 
					
						
							|  |  |  |    yarn workspace @calcom/prisma db-migrate | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    (this can clear your development database in some cases) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    In a production environment, run: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```sh | 
					
						
							|  |  |  |    yarn workspace @calcom/prisma db-deploy | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 3. Check the `.env.example` and compare it to your current `.env` file. In case there are any fields not present | 
					
						
							|  |  |  |    in your current `.env`, add them there. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    For the current version, especially check if the variable `BASE_URL` is present and properly set in your environment, for example: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```text | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    BASE_URL='https://yourdomain.com' | 
					
						
							|  |  |  |    ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 4. Start the server. In a development environment, just do: | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```sh | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    yarn dev | 
					
						
							|  |  |  |    ``` | 
					
						
							|  |  |  |    For a production build, run for example: | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  |    ```sh | 
					
						
							| 
									
										
										
										
											2022-02-11 19:33:35 +00:00
										 |  |  |    yarn build | 
					
						
							|  |  |  |    yarn start | 
					
						
							|  |  |  |    ``` | 
					
						
							| 
									
										
										
										
											2022-02-21 20:47:50 +00:00
										 |  |  | 5. Enjoy the new version. |