Skip to content

SOP for registering client and demo database

Roi Larrence Amatong edited this page Jul 29, 2021 · 4 revisions

Overview

This page contains the instructions on how to handle the registrations of new client and demo databases. Unfortunately, handling the database is done manually in order to be published to live. The shared web hosting server does not allowed to programmatically create a database on the live database server. So process described below are done locally then manually import the application to the live server. This is the same for demo and client database.

Register Demo Database

  1. Open Visual Studio Code and open Reserbiz workspace directory.
  2. Run the Web API application by running the cli command below.
cd .\ReserbizAPP.API\
dotnet watch run
  1. Open Postman application.
  2. Open request tab Reserbiz Application/Clients/Register new demo.
  3. Make sure the request URL is pointing to the localhost web api server.
  4. Go to Body tab, provide request payload with the information of the client. See example below. Click the Send button.
{
    "name": "Twice Inc.",
    "firstname": "Jihyo",
    "middlename": "Park",
    "lastname": "Park",
    "emailAddress": "park.jihyo@gmail.com",
    "contactnumber": "09979476977"
}
  1. An email will be sent afterwards to the email address provided on the request payload. See example email content below.
Hi Jihyo Park,

Get started on your test period!

Here, your login information comes to a demo account that shows what Reserbiz looks like and how it can help you with your business.

Login to Reserbiz. You can already log in and see Reserbiz on your own.

Company: Twice Inc.
Username: jipa
Password: Starta123

Your test period is valid until Oct 28, 2021

We hope you enjoy it!
Reserbiz
  1. The process above involve the creation of database demo on the local SQL server. Open SQL Server Management Studio application and locate the newly created database. Create a backup of this database and place it on D:\Database\Backup directory because we will manually import it on the live database server.
  2. On the SSMS application, connect to the local database server. Run the script below to get the information of the newly created demo database. This data will be later used on the next step.
SELECT TOP 1 * FROM Clients WHERE [Type] = 1 ORDER BY Id DESC
  1. On the SSMS application, connect to the database live server sql5104.site4now.net using the username db_a727c0_dbreserbizsyssql_admin, password can be found on Keepass. Open a new query window and run the script provided below. Use the column values of the newly created demo client information from the script provided on the previous step to supply on the following variables below on the script. For now, we will only provide the Company Name, Database Name, Database HashName, Contact Number, Date Joined and Date Created. After we import the actual database on the live server on the succeeding steps, we will then provide the Database Server, Database Username and Database Password.
USE db_a727c0_dbreserbizsyssql;

-- Insert new client information
DECLARE @companyName AS NVARCHAR(MAX)
DECLARE @dbname AS NVARCHAR(MAX)
DECLARE @dbhashname AS NVARCHAR(MAX)
DECLARE @contactinfo AS NVARCHAR(MAX)
DECLARE @datejoined AS DATETIME
DECLARE @datecreated AS DATE
DECLARE @dbtype AS INT

SET @companyName = '<CompanyName>'
SET @dbname = '<DatabaseName>'
SET @dbhashname = 'DatabaseHasName'
SET @contactinfo = '<ContactNumber>' 
SET @datejoined = '<DateJoined>'
SET @datecreated = '<DateCreated>'
SET @dbtype = <DatabaseClientType> -- (1) for Demo and (2) for Regular

INSERT INTO Clients (
	Name
	, DBName
	, DBHashName
	, Description
	, ContactNumber
	, DateJoined
	, DateEnded
	, IsActive
	, IsDelete
	, DateDeleted
	, DateDeactivated
	, DateCreated
	, DateUpdated
	, Type
) VALUES (
	@companyName, 
	@dbname, 
	@dbhashname
	,NULL
	, @contactInfo
	, @datejoined
	, ''
	, 1	
	, 0	
	, ''
	, ''
	, @datecreated
	, ''
	, @dbtype
)
  1. At this point, we will now import the database to live server. To do this, login to the hosting server website. Account credentials is available on Keepass.
  2. Proceed to Database -> MSSSQL. Click the Add Database button. This will open up a dialog. On the database name field, make sure to enter the database name, the only thing that we will provide on the field is the portion of the database name after the prefix db_a727c0_. Example: demo36 so the final name is db_a727c0_demo36. For the password field, we will provide a standard password which is Starta123. On this particular process, what we did is we create a new database user account with one database. The Login ID will be the username, the server is the [SQLDomainServer].site4now.net and the password is Starta123. Add this new database server credentials as a new entry on Keepass under Personal/Reserbiz/Database Accounts group.
  3. Back from step #8, we have created a backup of the newly created database. Now, we will import it on the live database server. On the hosting webserver, go to Files. From the list of directory, select folder named db. From this folder, upload the database backup file.
  4. Back on the Databases -> MSSSQL, click the Restore option on the database that we recently created. From the restore page, go to the From My Account tab. From the left panel, locate the database backup file that we have just uploaded from the previous step and click Submit button. This will start the process of restoring the database. This will normally take just few minutes.
  5. Back on the Databases -> MSSSQL, on the newly created database, click on More icon -> Database User Manager menu option. On this page, we will assign the shared database user credentials on the newly restored database. This credentials will be used on the connection string.
  • If there is already an existing shared database user under the database server where the newly created database belongs, then assign this shared db user. To do this, click the Assign Additional DB button from any of the database in list that belongs to the same database server. From inside the dialog, select the database from the list and click Submit button.
  • If there is no shared database user under the database server where the newly created database belongs, then we will create one and assign this to the database. To do this, click the +MSSQL User button above. From the database dropdown, select the newly created database. Then on Username field, provide the username, we will have a standard naming for this which is reserbiz[N] where N is the current number of shared db user that we have. For password, we will just provide Starta123. Click the Check All button to enable all Roles & Permissions. Lastly, click the Submit button.
  1. After successfully doing the step #15, we have now the database on the live server.
  2. Back on step #10, we have inserted the information related with the newly created database on table Clients. Now, we will have to update it and provide the Database Server, Database Username and Database Password that we have gathered during the process of importing database on the live server. Provide the database user credentials and run the script below.
USE db_a727c0_dbreserbizsyssql;

DECLARE @Id INT
DECLARE @DbServer VARCHAR(MAX)
DECLARE @DbUsername VARCHAR(MAX)
DECLARE @DbPassword VARCHAR(MAX)

SET @Id = <ClientId>;
SET @DbServer = '<Database Server>';
SET @DbUsername = <Shared Database Username>;
SET @DbPassword = <Shared Database Password>;

UPDATE Clients SET 
	DBPassword = @DbPassword
	, DBServer = @DbServer
	, DBusername = @DbUsername 
WHERE Id = @Id
  1. Test the database on the mobile application by login in using the credentials provided on the email from the step #7.

Register Regular Client Database

  1. Open Visual Studio Code and open Reserbiz workspace directory.
  2. Run the Web API application by running the cli command below.
cd .\ReserbizAPP.API\
dotnet watch run
  1. Open Postman application.
  2. Open request tab Reserbiz Application/Clients/Register new client.
  3. Make sure the request URL is pointing to the localhost web api server.
  4. Go to Body tab, provide request payload with the information of the client. See example below. Click the Send button.
{
    "name": "Eran Apts",
    "description": "EranApts",
    "firstname": "Flavianna",
    "middlename": "Johnston",
    "lastname": "Johnston",
    "emailAddress": "flavianna.johnston@gmail.com",
    "contactnumber": "0665639458"
}
  1. An email will be sent afterwards to the email address provided on the request payload. See example email content below.
Hi Flavianna Johnston,

Thank you for choosing Reserbiz!

Below you will find your personal login details:

Company: EranApts
Username: fljo
Password: Starta123

We hope you enjoy it!
Reserbiz
  1. The process above involve the creation of database demo on the local SQL server. Open SQL Server Management Studio application and locate the newly created database. Create a backup of this database and place it on D:\Database\Backup directory because we will manually import it on the live database server.
  2. On the SSMS application, connect to the local database server. Run the script below to get the information of the newly created demo database. This data will be later used on the next step.
SELECT TOP 1 * FROM Clients WHERE [Type] = 2 ORDER BY Id DESC
  1. On the SSMS application, connect to the database live server sql5104.site4now.net using the username db_a727c0_dbreserbizsyssql_admin, password can be found on Keepass. Open a new query window and run the script provided below. Use the column values of the newly created demo client information from the script provided on the previous step to supply on the following variables below on the script. For now, we will only provide the Company Name, Database Name, Database HashName, Contact Number, Date Joined and Date Created. After we import the actual database on the live server on the succeeding steps, we will then provide the Database Server, Database Username and Database Password.
USE db_a727c0_dbreserbizsyssql;

-- Insert new client information
DECLARE @companyName AS NVARCHAR(MAX)
DECLARE @dbname AS NVARCHAR(MAX)
DECLARE @dbhashname AS NVARCHAR(MAX)
DECLARE @contactinfo AS NVARCHAR(MAX)
DECLARE @datejoined AS DATETIME
DECLARE @datecreated AS DATE
DECLARE @dbtype AS INT

SET @companyName = '<CompanyName>'
SET @dbname = '<DatabaseName>'
SET @dbhashname = 'DatabaseHasName'
SET @contactinfo = '<ContactNumber>' 
SET @datejoined = '<DateJoined>'
SET @datecreated = '<DateCreated>'
SET @dbtype = <DatabaseClientType> -- (1) for Demo and (2) for Regular

INSERT INTO Clients (
	Name
	, DBName
	, DBHashName
	, Description
	, ContactNumber
	, DateJoined
	, DateEnded
	, IsActive
	, IsDelete
	, DateDeleted
	, DateDeactivated
	, DateCreated
	, DateUpdated
	, Type
) VALUES (
	@companyName, 
	@dbname, 
	@dbhashname
	,NULL
	, @contactInfo
	, @datejoined
	, ''
	, 1	
	, 0	
	, ''
	, ''
	, @datecreated
	, ''
	, @dbtype
)
  1. At this point, we will now import the database to live server. To do this, login to the hosting server website. Account credentials is available on Keepass.
  2. Proceed to Database -> MSSSQL. Click the Add Database button. This will open up a dialog. On the database name field, make sure to enter the database name, the only thing that we will provide on the field is the portion of the database name after the prefix db_a727c0_. Example: demo36 so the final name is db_a727c0_demo36. For the password field, we will provide a standard password which is Starta123. On this particular process, what we did is we create a new database user account with one database. The Login ID will be the username, the server is the [SQLDomainServer].site4now.net and the password is Starta123. Add this new database server credentials as a new entry on Keepass under Personal/Reserbiz/Database Accounts group.
  3. Back from step #8, we have created a backup of the newly created database. Now, we will import it on the live database server. On the hosting webserver, go to Files. From the list of directory, select folder named db. From this folder, upload the database backup file.
  4. Back on the Databases -> MSSSQL, click the Restore option on the database that we recently created. From the restore page, go to the From My Account tab. From the left panel, locate the database backup file that we have just uploaded from the previous step and click Submit button. This will start the process of restoring the database. This will normally take just few minutes.
  5. Back on the Databases -> MSSSQL, on the newly created database, click on More icon -> Database User Manager menu option. On this page, we will assign the shared database user credentials on the newly restored database. This credentials will be used on the connection string.
  • If there is already an existing shared database user under the database server where the newly created database belongs, then assign this shared db user. To do this, click the Assign Additional DB button from any of the database in list that belongs to the same database server. From inside the dialog, select the database from the list and click Submit button.
  • If there is no shared database user under the database server where the newly created database belongs, then we will create one and assign this to the database. To do this, click the +MSSQL User button above. From the database dropdown, select the newly created database. Then on Username field, provide the username, we will have a standard naming for this which is reserbiz[N] where N is the current number of shared db user that we have. For password, we will just provide Starta123. Click the Check All button to enable all Roles & Permissions. Lastly, click the Submit button.
  1. After successfully doing the step #15, we have now the database on the live server.
  2. Back on step #10, we have inserted the information related with the newly created database on table Clients. Now, we will have to update it and provide the Database Server, Database Username and Database Password that we have gathered during the process of importing database on the live server. Provide the database user credentials and run the script below.
USE db_a727c0_dbreserbizsyssql;

DECLARE @Id INT
DECLARE @DbServer VARCHAR(MAX)
DECLARE @DbUsername VARCHAR(MAX)
DECLARE @DbPassword VARCHAR(MAX)

SET @Id = <ClientId>;
SET @DbServer = '<Database Server>';
SET @DbUsername = <Shared Database Username>;
SET @DbPassword = <Shared Database Password>;

UPDATE Clients SET 
	DBPassword = @DbPassword
	, DBServer = @DbServer
	, DBusername = @DbUsername 
WHERE Id = @Id
  1. Test the database on the mobile application by login in using the credentials provided on the email from the step #7.