SlideShare a Scribd company logo
© 2016 Magento, Inc. Page | 1
© 2016 Magento, Inc. Page | 2
Agenda
1. Deployment types
2. File permissions
3. Connecting to Marketplace
4. Upgrading procedure
5. Q&A
© 2016 Magento, Inc. Page | 3
Deployment Types
© 2016 Magento, Inc. Page | 4
Deployment Types
Development DeploymentProduction Deployment
Requirements:
- Secure
- Reliability
- Performance
- Flexible deployment settings
Requirements:
- Easy to deploy
- Developer tools & debugging
© 2016 Magento, Inc. Page | 5
Deployment Types
Extension
Contributing
Self-hosted
Cloud
Shared hosting
Development DeploymentProduction Deployment
© 2016 Magento, Inc. Page | 6
Source of the Code
• Composer
• Git
• Archives
• Ready VM boxes:
– Vagrant
– Docker
Contributing dev
Extension dev Production
Production
© 2016 Magento, Inc. Page | 7
Application Modes
developer
• Errors displayed
• Auto-generated
static files
production
• Errors logged
• Pre-generated
static files
default
• A simplified
“production”
• Errors logged
• Auto-generated
static files
For development
For production
© 2016 Magento, Inc. Page | 8
File permissions
© 2016 Magento, Inc. Page | 9
File Permissions
• Single user
– A single user for both command line and web
– Less flexibility for permissions management
– Simplified setup
– Good for development
– May be the only option for shared hosting
• Two users: a web user and a command line user
– Better flexibility for permissions management
– More complicated setup
– Good for production
Production on shared hostingDevelopment
Production
© 2016 Magento, Inc. Page | 10
Two Users Setup
• Command line user is the owner of the files and has full/extended
permissions
– Run Magento console commands and Cron from this user
• Web user is in the same group and has limited permissions
– Run web server from this user
• Both users are in the same primary group
drwxr-xr-x 15 olga www-data 646 Aug 30 19:16 app
Command line Web user
© 2016 Magento, Inc. Page | 11
Magento Application: Read-Only Paths
• /
• app
• bin
• devlib
• phpserver
• pub
• pub/errors
• pub/static
• setup
• update
• var/di
• var/generation
• vendor
© 2016 Magento, Inc. Page | 12
Magento Application: Writeable Paths
• pub/media
• app/etc/env.php – for cache status management
• var/cache
• var/page_cache
• var/log
• var/report
• var/session
• pub/static/merged – for static files merging
• var/view_preprocessed – for static files merging
• pub/opt/magento/var/resource_config.json - for DB media
storage
• var/composer_home – for Setup Wizard
© 2016 Magento, Inc. Page | 13
Connecting to Marketplace
© 2016 Magento, Inc. Page | 14
Marketplace Credentials
• Marketplace keys ≠ marketplace username and password
© 2016 Magento, Inc. Page | 15
Marketplace Keys Location
• Two places where the keys are stored:
– If you run Composer commands – Composer dir in user home folder
(/home/olga/.composer/auth.json)
– If you use Setup Wizard – Composer dir in Magento folder
(/var/www/magento/var/composer_home/auth.json)
© 2016 Magento, Inc. Page | 16
Upgrading Procedure
© 2016 Magento, Inc. Page | 17
Composer-based Upgrade (Command Line)
• magento maintenance:enable
• composer require magento/product-community-edition
2.1.1 --no-update
• composer update
• magento setup:upgrade
• Generate DI and static view files:
– magento setup:di:compile
– magento setup:static-content:deploy
• magento maintenance:disable
© 2016 Magento, Inc. Page | 18
Git-based Upgrade (Command Line)
Assumption: you are a contributing developer
• git fetch magento
• git merge magento/develop
• composer install
• magento setup:upgrade
© 2016 Magento, Inc. Page | 19
Upgrade via Web Setup Wizard
• Admin Panel > System > Tools > Setup Wizard
• Select “System Upgrade”
• Select version
• Optional: select other components to upgrade
– Some components may require the upgrade to remain compatible with
the new Magento version
• Go through the steps
© 2016 Magento, Inc. Page | 20
Upgrading Production: Steps
On Staging
1. Upgrade the code
2. Clean generated files
3. Upgrade DB
4. Generate DI
5. Generate static view files
If you are an extension developer, reduce your extension’s upgrade time. Optimize setup
scripts:
- Implement one-step upgrade through multiple versions
- Validate upgrade scripts on big DB
On Production
1. Enable maintenance mode
2. Fetch updated code
3. Upgrade DB with --keep-
generated
4. Disable maintenance mode
© 2016 Magento, Inc. Page | 21
Proper Way to Generate Files on Staging
• Configure same set of enabled/disabled modules as on production
– For both DI and static view files
• Static view files:
– Install Magento on the same code on staging
– Locales:
• setup staging store with the same languages
• or specify languages used on production
– Use --theme option to speed-up the process
© 2016 Magento, Inc. Page | 22
Olga Kopylova
Q&A

More Related Content

PPTX
Mage Titans USA 2016 - Igor Melnykov - Staging and Preview
PDF
The journey of mastering Magento 2 for Magento 1 developers
PPTX
Magento 2: A technical overview
PDF
Max Yekaterinenko - Magento 2 & Quality
PPTX
Meet Magento Belarus - Sergey Ivashchenko
PDF
Magento 2 Module in 50 Minutes
PDF
Sergii Shymko - Code migration tool for upgrade to Magento 2
PPTX
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Mage Titans USA 2016 - Igor Melnykov - Staging and Preview
The journey of mastering Magento 2 for Magento 1 developers
Magento 2: A technical overview
Max Yekaterinenko - Magento 2 & Quality
Meet Magento Belarus - Sergey Ivashchenko
Magento 2 Module in 50 Minutes
Sergii Shymko - Code migration tool for upgrade to Magento 2
Sergii Shymko: Magento 2: Composer for Extensions Distribution

What's hot (20)

PDF
PWA for PHP Developers
PDF
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
PDF
A Successful Magento Project From Design to Deployment
PDF
Igor Bondarenko - Magento2 Performance Bottlenecks: How to avoid it
PPTX
Meet Magento Belarus 2015: Mladen Ristić
PDF
Magento 2: New and Innovative? - php[world] 2015
PPTX
Meet Magento Belarus 2015: Uladzimir Kalashnikau
PDF
Fundamentals of Extending Magento 2 - php[world] 2015
PPT
Meet Magento Belarus 2015: Jurģis Lukss
PDF
Magento 2 Development for PHP Developers
PPTX
Integrate any Angular Project into WebSphere Portal
PPTX
How to Install Magento 2 on XAMPP Server localhost.
PPTX
Phpworld.2015 scaling magento
PPTX
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
PDF
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015
PDF
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
PDF
Modern Web Application Development Workflow - EclipseCon US 2014
PDF
Tech talk live custom content viewers in alfresco share
PDF
Magento 2: Modernizing an eCommerce Powerhouse
PDF
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
PWA for PHP Developers
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
A Successful Magento Project From Design to Deployment
Igor Bondarenko - Magento2 Performance Bottlenecks: How to avoid it
Meet Magento Belarus 2015: Mladen Ristić
Magento 2: New and Innovative? - php[world] 2015
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Fundamentals of Extending Magento 2 - php[world] 2015
Meet Magento Belarus 2015: Jurģis Lukss
Magento 2 Development for PHP Developers
Integrate any Angular Project into WebSphere Portal
How to Install Magento 2 on XAMPP Server localhost.
Phpworld.2015 scaling magento
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Modern Web Application Development Workflow - EclipseCon US 2014
Tech talk live custom content viewers in alfresco share
Magento 2: Modernizing an eCommerce Powerhouse
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Ad

Similar to Mage Titans USA 2016 M2 deployment (20)

PPTX
Magento Cloud - Introduction
PDF
Mli 2017 technical intro to magento 2
PDF
Oleh Kobchenko - Configure Magento 2 to get maximum performance
PPTX
How to edit the core
PDF
Getting to know magento
PPTX
Magento 2 overview. Alan Kent
PDF
Rock-solid Magento Development and Deployment Workflows
PDF
Jason Woosley - Community Engagement 2.0 - Mage Titans Manchester 2016
PPTX
Magento 2 Best Practice MLUK17
PDF
Mli 2017 technical m2 developer experience
PDF
Magento Meetup Mancheter with PushON: Elena Leonova
PDF
Zepplin_Pronko_Magento_Festival Hall 1_Final
PPTX
php[world] Magento101
PPTX
Max Yekaterynenko: Magento 2 overview
PPTX
Magento 2 : development and features
PDF
DevHub 3 - Composer plus Magento
PPTX
Zendcon magento101
PDF
How to Install Magento on WAMP Server
PDF
How to Install Magento 2 [Latest Version]
PDF
Ryan_scott_magentocom_china_keynote_18112013
Magento Cloud - Introduction
Mli 2017 technical intro to magento 2
Oleh Kobchenko - Configure Magento 2 to get maximum performance
How to edit the core
Getting to know magento
Magento 2 overview. Alan Kent
Rock-solid Magento Development and Deployment Workflows
Jason Woosley - Community Engagement 2.0 - Mage Titans Manchester 2016
Magento 2 Best Practice MLUK17
Mli 2017 technical m2 developer experience
Magento Meetup Mancheter with PushON: Elena Leonova
Zepplin_Pronko_Magento_Festival Hall 1_Final
php[world] Magento101
Max Yekaterynenko: Magento 2 overview
Magento 2 : development and features
DevHub 3 - Composer plus Magento
Zendcon magento101
How to Install Magento on WAMP Server
How to Install Magento 2 [Latest Version]
Ryan_scott_magentocom_china_keynote_18112013
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25 Week I
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation theory and applications.pdf
sap open course for s4hana steps from ECC to s4
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing

Mage Titans USA 2016 M2 deployment

  • 1. © 2016 Magento, Inc. Page | 1
  • 2. © 2016 Magento, Inc. Page | 2 Agenda 1. Deployment types 2. File permissions 3. Connecting to Marketplace 4. Upgrading procedure 5. Q&A
  • 3. © 2016 Magento, Inc. Page | 3 Deployment Types
  • 4. © 2016 Magento, Inc. Page | 4 Deployment Types Development DeploymentProduction Deployment Requirements: - Secure - Reliability - Performance - Flexible deployment settings Requirements: - Easy to deploy - Developer tools & debugging
  • 5. © 2016 Magento, Inc. Page | 5 Deployment Types Extension Contributing Self-hosted Cloud Shared hosting Development DeploymentProduction Deployment
  • 6. © 2016 Magento, Inc. Page | 6 Source of the Code • Composer • Git • Archives • Ready VM boxes: – Vagrant – Docker Contributing dev Extension dev Production Production
  • 7. © 2016 Magento, Inc. Page | 7 Application Modes developer • Errors displayed • Auto-generated static files production • Errors logged • Pre-generated static files default • A simplified “production” • Errors logged • Auto-generated static files For development For production
  • 8. © 2016 Magento, Inc. Page | 8 File permissions
  • 9. © 2016 Magento, Inc. Page | 9 File Permissions • Single user – A single user for both command line and web – Less flexibility for permissions management – Simplified setup – Good for development – May be the only option for shared hosting • Two users: a web user and a command line user – Better flexibility for permissions management – More complicated setup – Good for production Production on shared hostingDevelopment Production
  • 10. © 2016 Magento, Inc. Page | 10 Two Users Setup • Command line user is the owner of the files and has full/extended permissions – Run Magento console commands and Cron from this user • Web user is in the same group and has limited permissions – Run web server from this user • Both users are in the same primary group drwxr-xr-x 15 olga www-data 646 Aug 30 19:16 app Command line Web user
  • 11. © 2016 Magento, Inc. Page | 11 Magento Application: Read-Only Paths • / • app • bin • devlib • phpserver • pub • pub/errors • pub/static • setup • update • var/di • var/generation • vendor
  • 12. © 2016 Magento, Inc. Page | 12 Magento Application: Writeable Paths • pub/media • app/etc/env.php – for cache status management • var/cache • var/page_cache • var/log • var/report • var/session • pub/static/merged – for static files merging • var/view_preprocessed – for static files merging • pub/opt/magento/var/resource_config.json - for DB media storage • var/composer_home – for Setup Wizard
  • 13. © 2016 Magento, Inc. Page | 13 Connecting to Marketplace
  • 14. © 2016 Magento, Inc. Page | 14 Marketplace Credentials • Marketplace keys ≠ marketplace username and password
  • 15. © 2016 Magento, Inc. Page | 15 Marketplace Keys Location • Two places where the keys are stored: – If you run Composer commands – Composer dir in user home folder (/home/olga/.composer/auth.json) – If you use Setup Wizard – Composer dir in Magento folder (/var/www/magento/var/composer_home/auth.json)
  • 16. © 2016 Magento, Inc. Page | 16 Upgrading Procedure
  • 17. © 2016 Magento, Inc. Page | 17 Composer-based Upgrade (Command Line) • magento maintenance:enable • composer require magento/product-community-edition 2.1.1 --no-update • composer update • magento setup:upgrade • Generate DI and static view files: – magento setup:di:compile – magento setup:static-content:deploy • magento maintenance:disable
  • 18. © 2016 Magento, Inc. Page | 18 Git-based Upgrade (Command Line) Assumption: you are a contributing developer • git fetch magento • git merge magento/develop • composer install • magento setup:upgrade
  • 19. © 2016 Magento, Inc. Page | 19 Upgrade via Web Setup Wizard • Admin Panel > System > Tools > Setup Wizard • Select “System Upgrade” • Select version • Optional: select other components to upgrade – Some components may require the upgrade to remain compatible with the new Magento version • Go through the steps
  • 20. © 2016 Magento, Inc. Page | 20 Upgrading Production: Steps On Staging 1. Upgrade the code 2. Clean generated files 3. Upgrade DB 4. Generate DI 5. Generate static view files If you are an extension developer, reduce your extension’s upgrade time. Optimize setup scripts: - Implement one-step upgrade through multiple versions - Validate upgrade scripts on big DB On Production 1. Enable maintenance mode 2. Fetch updated code 3. Upgrade DB with --keep- generated 4. Disable maintenance mode
  • 21. © 2016 Magento, Inc. Page | 21 Proper Way to Generate Files on Staging • Configure same set of enabled/disabled modules as on production – For both DI and static view files • Static view files: – Install Magento on the same code on staging – Locales: • setup staging store with the same languages • or specify languages used on production – Use --theme option to speed-up the process
  • 22. © 2016 Magento, Inc. Page | 22 Olga Kopylova Q&A

Editor's Notes

  • #5: Deployment processes can be divided into two types: “Production deployment”. And “development deployment”, which is also deployment as a developer needs to deploy a Magento instance in order to start working with it. And, as we can see, the requirements are different for different types of deployment: Production is focused on final result: the working store. And so it must be secure, reliable and perform well. Usually, in order to reach all these and to reach specifics of the project, flexible deployment settings are necessary. Form the other hand, Development deployment must be simple, so that the developer could focus on the deployment itself instead of playing with deployment settings. And also it needs developer and debugging tools to simplify the development process.
  • #6: Each of these types can be divided more into sub-types. Deployment process for production highly depends on the project’s needs and abilities. It can be: Self-hosted, which gives the most flexibility Cloud hosted, which gives flexibility in resources, but still highly depends on the hosting features from flexibility perspective Shared hosting, which gives a simple solution for simple installations. Here I’d recommend to work with hosting providers that provide in-built Magento installation. This guarantee that you have all resources necessary for your Magento store to run. On other hand, development procedures are also different basing on the project’s purposes: This can be an extension development Or contributing development for Magento
  • #7: Basing on your deployment type, how do you obtain the code? Here are our recommendations: In most cases you should use Composer-based installation, where you run a Composer command and download whole project in “vendor/” directory. Only in case you’re a contributing developer and are working on a contribution to the Magento core code, please, use Git repository. This is the only case, when it should be used. There are also zip/gzip/bzip archives for your convenience. It is an alternative to the Composer-based installation. Just that the Composer commands are pre-run by Magento release tools and the archives are packaged with downloaded code in them. The result should be the same as if Composer is used. This would make sense to use if you just want to try Magento and don’t want to install additional tools or/and if you want to deploy Magento on a shared hosting with no access to console where you’d run the composer commands. Another alternative solution would be to use ready Vagrant or Docker boxes with pre-installed Magento. Or even w/o Magento in it, but with environment ready.
  • #8: There are three application modes in Magento 2: “developer”, “production” and “default”. Developer mode allows to see errors right on the page or in web API request. Also it makes the application auto-generate necessary static view files. Production mode is faster and safer, as it hides all error in log files and is intended for usage with pre-generated files. Default mode is a compromise between developer and production modes. It still hides errors, but it performs auto-generation of static view files, when necessary. It’s recommended to use either developer or production mode.
  • #10: There are two recommended ways of setting up file permissions for Magento files. A “single-user setup” is a simplified one. It’s when you have a single user you use for any actions with the files – for the web-server, for console access. It may be the only option with shared hosting. It’s simple in usage because there can’t be any conflicts in access to the files, as all files are created and accessed by the same user. A more flexible approach to permissions management is to use two different users for accessing files. In this case, you’d have one user for console access and another user for web-server. It gives you ability to setup permissions in more flexible way.
  • #11: The console user should be the owner of the files (in most cases) and should have full (or highest) permissions to the files. Use this user for running console commands and crons. The web user should have limited access: read-access to most of the files and write access to a limited number of files that the Magento web application really needs. Both users should be in the same primary group. So, basically, the web user gets access to the files basing on the group.
  • #12: Let’s see which permissions are necessary for the web user in case of two-users setup. This is a setup for the group permissions. Follow the rule “deny-allow”, or in our case “read-write”. First, give read-only permissions to, basically, everything.
  • #13: And then give write permissions only to the files and folders that are really necessary in your case. For production, here is a list of paths that must be writable.
  • #15: All Magento packages, including extensions and Magento core packages, are distributed via Marketplace. In order to download the packages for your installation, it is necessary to have Marketplace keys. The keys are not the same as Marketplace username and password. The reason for this differentiation is that username and password allow you manage your entire Marketplace account (make purchases, change your information, etc.). And Marketplace keys allow only one thing – download already purchased packages. Also, you can revoke the keys at any time and replace them with the new ones, if the old ones are compromised.
  • #16: When you deploy Magento, the keys are usually stored for future usages (e.g., in case of upgrade or installation of new extensions). The keys, actually, can be stored in two different places depending on the actions you perform: If you run Composer commands (e.g., “composer create-project”), the keys you specify are stored in the Composer’s home folder, which is usually under your OS user’s folder If you run Magento commands or specify the keys in the Setup Wizard, the keys are stored in a special Composer folder under Magento project. The reason for existence and usage of these two places is a potentially different version of Composers used in different processes. Magento actions (console commands and Setup Wizard) use a specific version, embedded in the Magento project. Composer used as a separate tool and installed in your system may be of a totally different versions. And if these versions store data in different format, the results can be unexpected in case auth.json file is stored by one version of Composer and then loaded by another.
  • #17: Upgrade is another big topic. There are different ways to upgrade Magento store. And it highly depends on how you deployed it. I’ll go through a few options, which should be general enough to be applied for other specific cases.
  • #18: Composer-based upgrade via console. It is applicable in case you have a Composer-based or an archive-based deployment AND you have access to console and want to use console for the upgrade process. It’s the preferable procedure. So… If it’s necessary to lock the store, enable maintenance mode Uprgade dependency on a new version of Magento product using “composer require” command with “--no-update” option composer upgrade. It’s necessary to run these two commands instead of only “require” command because in this case all dependencies will be updated vs. only specified one, which helps avoid compatibility issues Upgrade Magento DB: magento setup:upgrade By default the upgrade command cleans generated files. If you’re in production mode or want to speed-up the store, generate new files Disable maintenance mode
  • #19: Another console-based approach is for Git-based installation. It is the way contributing developers would go with. Assuming you have a remote named “magento” for the original Magento repository Fetch magento Merge magento/develop into your branch Run “composer install” to update dependencies. It’s important to run “composer install”, not “composer update” – it guarantees that all developers will work with the same set of dependencies, even if some of them are not strictly defined Upgrade DB: magento setup:upgrade Now your Magento installation should be on the new version.
  • #20: And one more way to upgrade is to use Setup Wizard. It is applicable in case you don’t have access to the command line. Go to Admin Panel > System > Tools > Web Setup Wizard. And there select System Upgrade. Select version Optionally select other components to upgrade. It is recommended to do this though, as some installed components may be incompatible with new version of Magento, so it’s better to upgrade them to the new, compatible versions. Then just go through the steps
  • #21: Now, I’d like to focus for a moment on how you’d upgrade real production. Though, in general the result should be the same, you’d like to reduce downtime as much as possible. In this case it’s recommended to have a staging server additionally to the production one. The staging server should have a copy of your production - same code base. DB and user data may differ, but the application must be installed. Then, to perform upgrade: Do the upgrade on the staging server: Upgrade the code (Composer-based precedure via console) Clean generated files Upgrade DB Generate DI and static view files Then you need to move the updated code to production: Put production in maintenance code Replace the code with the one from staging. Here you may use Git and make ”git pull” or you may copy a zip archive to the production and now unzip it. But, independenctly on the approach, ensuew that you REPLACE the files, not COPYING them ON TOP. You must be sure that files that are not present in the new version, are removed. Just be sure that you don’t replace user data and environment configuration. Upgrade DB with --keep-generated option (as you already have files generated for the new version, you do not want them to be removed) Disable maintenance mode With this approach, the only downtime is caused by two actions: replacing the code (with can be very quick depending on your approach to doing this; e.g., you could pre-populate the new Magento folder and then just rename it to the “current” on in an instant) DB upgrade. This highly depends on the size of your DB and on efficiency of upgrade scripts of the extensions. If there are extension developers here, a request to you would be to test upgrades of your extensions on big DB, and optimize the scripts if possible.
  • #22: About files generation. During deployment and upgrade it is necessary to generate DI and static view files for your production. As I just described, in order to reduce downtime on production, it is recommended to generate these files on staging. Here are few insights about this process: Use “setup:di:compile” command for generating DI files Use “setup:static-content:deploy” command for generating static view files. A few notes about this command: It requires installed Magento instance to run. But it’s not necessary to have an identical DB, as on production. What must be identical is to have same themes on staging (Magento will register them in DB automatically, so the DB will have same set of themes and so will perform files generation compatible with your production). What may be identical, but may be bypassed: same stores with same locales selected. The command automatically identifies set of locales used in the application to deploy files for these locales. But you can bypass this requirement by manually specifying necessary languages as command’s arguments. Just ensure that you don’t forget any language (locale) used on production. In most cases you don’t use default Magento frontend theme on production. To speedup the generation process you can specify only themes you use on production, so files will be generated for these themes only. Use --theme option. An important moment for both commands is to have same set of enabled modules on both staging and production. Both commands may generate different result, if the sets are different.