Inhalte aufrufen

Profilbild
- - - - -

How To Deploy Localhost Smartstore Project To Live Server


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
3 Antworten zu diesem Thema

#1 aamad

aamad

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 06 September 2023 - 11:52

 I have a problem that when i launch smartstore in localhost and add my own products but when i deploy this in live server then it lost my all localhost database records.
It started from installation step.
How can i deploy it in live server and also with localhost database records?
And bypass the installation step?


#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 06 September 2023 - 12:25

By providing a database connection string to your server-side database in the file \App_Data\Tenants\Default\Settings.txt.


Marcus Gesing

Smartstore AG


#3 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 462 Beiträge

Geschrieben: 06 September 2023 - 13:56

Certainly! It sounds like you’re facing a common challenge when moving from a local development environment to a live server. Here’s a step-by-step guide to help you:

  1. Backup Local Database:

    • Before making any changes, always backup your local database. This ensures you have a fallback option in case anything goes wrong.
  2. Export Local Database:

  3. Prepare Live Server:

    • Set up your live server with the necessary database system (e.g., MySQL, SQL Server).
    • Create a new database on your live server for Smartstore.
    • Obviously, you have also to create a database user, who can access this new database in your database system.
      You have to setup all the neccessary access rights, there are a lot of them in SQL.
    • You need to write down the credentials on paper! (the database location, the database name, the database user name, and his passwort)
  4. Import Local Database to Live Server:

    • Use the same tool (phpMyAdmin or SSMS) to import the .sql file you exported from your local machine to the new database on your live server.
  5. Update Connection String:

    • In your Smartstore project, locate the appsettings.json or web.config file (depending on your setup).
    • Update the database connection string to point to your live server’s database, using the appropriate credentials.
  6. Bypass Installation Step:

    • Since you’ve already installed Smartstore on your localhost, you have the necessary tables and configurations in your database.
    • By importing your local database to your live server and updating the connection string, you should be able to bypass the installation step when accessing Smartstore on the live server.
  7. Deploy Smartstore to Live Server:

    • Deploy your Smartstore application to your live server as you normally would. Since you’ve already set up the database and updated the connection string, it should connect to the live database seamlessly.
  8. Test Everything:

    • Once deployed, thoroughly test your live site to ensure all products, configurations, and other data from your localhost are present and functioning correctly.

Remember, always keep backups of both your local and live databases before making significant changes. Always note passwords, credentials well organized and keep it somewhere on paper save and off-line. This ensures you can quickly recover in case of any unforeseen issues.


Stefan


#4 aamad

aamad

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 07 September 2023 - 07:17

  1. Update Connection String:

    • In your Smartstore project, locate the appsettings.json or web.config file (depending on your setup).
    • Update the database connection string to point to your live server’s database, using the appropriate credentials.

I could not find any connection string in web.config file and appsetting.json file. When i publish project then in build folder it is not creating tenent folder where connection string stored.