If you're using Private Hosting (VPS or dedicated server), make sure that you have the following available:
If your server doesn't allow each of these items, YetaWF cannot be hosted.
Using Visual Studio's Publish feature is NOT recommended, because YetaWF makes extensive use of symbolic links from the website to source packages, which cannot be deployed by Visual Studio.
Follow these steps to deploy your site to a Private Hosting server. It is assumed that you have the site running locally on your development system and are using the same domain name locally (using your hosts file).
The CopySite utility will zip your website files, backup your SQL DBs (if any) and upload the resulting file to your server. In order to do so, you have to customize the "CopySite FROM DEV.txt" file, which contains information specific to your local development system. The "CopySite FROM DEV.txt" file is located at ".\Utilities\CopySite", relative to your YetaWF solution folder. Later you will customize the "CopySite PROD.txt" file, which contains your server specific information.
# SQL Databases # Development system DBs (adjust as needed) DevDB yourDEVdatabasename,yourPRODdatabasename,sqlservername,username,password # additional DevDB statements if you have more DBs # ASP.NET Core sites are first published using Visual Studio (manually), then deployed from the target location where the site was published. # Specify an absolute path - The PublishOutput statement is required. PublishOutput C:\Temp\PublishOutput # Relative location of the website we want to deploy SiteLocation ..\..\Website # The location where the zip file is created ZipFile .\TEMP\Website.zip # The config file portion that is used for app.config, AppSettings.json, hosting.json, web.config. # Optional. When specified, the config file name adds the specified ConfigParm string before the extension. The ConfigParm string can contain periods. # In this example, the files app.Prod.config, AppSettings.Prod.json, hosting.Prod.json and Web.Prod.config are copied for deployment # named app.config, AppSettings.json, hosting.json, web.config on the deployed site. # If one of the files app.Prod.config, AppSettings.Prod.json, hosting.Prod.json or Web.Prod.config does not exist, the matching # file (without the ConfigParm string) is copied instead. ConfigParm Prod # The name of the web.config file to use on the site (located at SiteLocation) # The ConfigFile statement should no longer be used - Use ConfigParm instead #ConfigFile Web.Prod.config # Additional folders to copy (part of Zip file - must match folders in PROD) - PRIVATE HOSTING ONLY #CopyFolder ..\localpath # Define what to upload # .\TEMP\Website.zip is the file to be uploaded (local path), /Website.zip is the full path of the zip file on the server (adjust as needed) Upload ftp://serveraddress, ftpuser, ftppassword, .\TEMP\Website.zip, /Website.zip # additional Upload statements if needed # The following Upload statements are for PRIVATE HOSTING ONLY Upload ftp://serveraddress, ftpuser, ftppassword, .\CopySite PROD.txt, /CopySite PROD.txt Upload ftp://serveraddress, ftpuser, ftppassword, .\CopySite PROD.bat, /CopySite PROD.bat # Define folders to upload (not part of Zip file) - PRIVATE HOSTING ONLY # The CopySite utility is needed to unpack the zip file so we have to copy it outside the zip file UploadFolder ftp://serveraddress, ftpuser, ftppassword, .\Bin, /Utilities/CopySite/Bin
Add a DevDB statement for each SQL database you want to transfer to your server. If you don't use SQL DBs, remove the DevDB statements
yourDEVdatabasename | The name of your database on the development system. |
yourPRODdatabasename | The name of your database on the server. |
sqlservername | The SQL server name on the development system. |
username | User login information for the SQL server name on the development system. |
password | User login information for the SQL server name on the development system. |
ASP.NET Core only: The PublishOutput statement defines where your website was published by Visual Studio. This step is required for ASP.NET Core sites. The folder defined by the PublishOutput statement must match the folder used as target folder when publishing your site using the "File System" publish method.
The SiteLocation statement defines where your site files are located on your development system, relative to the "CopySite FROM DEV.txt" file. You normally don't need to change this.
The ZipFile statement defines where the zip file is created. You normally don't need to change this. The zip file contains all files for your website (including SQL DBs).
Defines the file name for all configuration files (app.config, AppSettings.json, hosting.json, web.config). When specified, the specified ConfigParm string is added to the config file name before the extension. The ConfigParm string can contain periods. For example, then ConfigParm Prod is specified, the files app.Prod.config, AppSettings.Prod.json, hosting.Prod.json and Web.Prod.config are copied for deployment and are named app.config, AppSettings.json, hosting.json, web.config on the deployed site. If one of the files app.Prod.config, AppSettings.Prod.json, hosting.Prod.json or Web.Prod.config does not exist on the development system, the matching file (without the ConfigParm string) is copied instead.
Do not use - This has been replaced by the ConfigParm statement.
The ConfigFile statement defines which file is copied to your server as Web.config file. This file is renamed to Web.Config by the CopySite utility when your site is uploaded - Your development system's Web.Config file is NOT used on the server. The default file used by a standard YetaWF installation is Web.Prod.config but you can rename the file so it reflects your site's name.
The CopyFolder statements define any additional folders you wish to copy to your server by adding them to your zip file. You can specify 0 or more statements and all files at the location on the local system defined by the argument will be added to the zip file. The file "CopySite PROD.txt" must have matching CopyFolder statements, in the same order, defining the server location where each folder is restored. CopyFolder copies folders recursively so all folders contained within the specified folder are transferred.
The Upload statement defines what files are uploaded. Multiple upload statements are allowed. In addition to the Upload statement for the zip file, additional Upload statements are used to upload the "Copysite PROD.txt" and "CopySite PROD.bat" files. These are required on the server to continue with the YetaWF installation.
Name | Description |
serveraddress | The FTP address of your server |
ftpuser | The FTP login |
ftppassword | The FTP password |
.\TEMP\Website.zip | The source location of a local file to transfer to your server |
/Website.zip | The target location/name of the file on your server |
On your server, the CopySite utility will unzip your website files and restore your SQL DBs (if any). In order to do so, you have to customize the "CopySite PROD.txt" file, which contains information specific to your server. Earlier you customized the "CopySite FROM DEV.txt" file, which contains information about your local development system.
# SQL Databases # Production system DBs (adjust as needed) ProdDB yourDEVdatabasename,yourPRODdatabasename,sqlservername,username,password # additional ProdDB statements if you have more DBs # Relative location of the website we want to deploy SiteLocation C:\targetpath.....\yoursite # The location of the ZIP file ZipFile C:\targetpath.....\Website.zip # Page to display on production system while we're installing MaintenancePage Offline For Maintenance.html # Set the update indicator file so the next restart will update/create all necessary models #UpdateIndicator # Additional folders to copy (must match folders in FROM DEV) #CopyFolder ..\targetpath
ProdDB statements are used to restore a SQL DB on your server. The database name must match a database name backed up in your "CopySite FROM DEV.txt" file.
yourDEVdatabasename | The name of your database on the development system. |
yourPRODdatabasename | The name of your database on the server. |
sqlservername | The SQL server name on the server. |
username | User login information for the SQL server name on the server. |
password | User login information for the SQL server name on the server. |
The SiteLocation statement defines where your site files are located on your server. Specify an absolute path.
The ZipFile statement defines where the zip file is located that was uploaded. Specify an absolute path. The zip file contains all files for your website (including SQL DBs).
Before your site is installed on your server by CopySite, the specified page is copied from the /Maintenance folder of your YetaWF site and added to your site as App_Offline.htm page. During the installation your site, visitors will see that page, which usually indicates that the site is under maintenance.
The UpdateIndicator statement can be used to force all packages to be updated/created when the site is restarted (see Upgrading In Development). This is normally not necessary. This is available and documented for future use.
The CopyFolder statements define the target location for folders that were added to the zip file using a matching CopyFolder statement in "CopySite FROM DEV.txt". Specify an absolute path. The folders must be listed in the same order as they are listed in the file "CopySite FROM DEV.txt".
Assuming your "CopySite FROM DEV.txt" and "CopySite PROD.txt" files have been updated and you have rebuilt your site (Release build), you're ready to upload your site by running CopySite on your development system.
.\Utilities\CopySite\CopySite FROM DEV.bat
If any errors occur, these are most likely caused by incorrect definitions in your "CopySite PROD.txt" file.
Once the zip file has been uploaded to your server, you're ready to unzip the file and install your site by running CopySite on your server. The location of the files "CopySite PROD.txt" and "CopySite PROD.bat" depend on what you specified in your "CopySite FROM DEV.txt" file in the respective Upload statements.
/Sites/CopySite (PROD).bat
Running CopySite restores all SQL DBs and all YetaWF files on your server.
Manually remove the App_Offline.htm page which was placed in the site's Website folder in order to display a "Maintenance in Progress" page while your site deployment was in progress.
You have completed all the steps to install your site and are ready to start it up.
Last Updated 11/12/2020 - (email)
© 2023 - Softel vdm, Inc. - YetaWF.com