Migrate from the online store to Hydrogen
This guide outlines considerations when migrating from the online store to Hydrogen.
Shared carts
Anchor link to section titled "Shared carts"Online store carts are compatible with the Storefront API and vice versa, making it possible to share carts between channels.
Both Liquid and Hydrogen cart IDs are stored in a cart
cookie, which prevents customers from losing carts when migrating to or from Hydrogen.
Subdomain for checkout
Anchor link to section titled "Subdomain for checkout"Regardless of whether you're using the online store or Hydrogen, customers are always directed back to a Shopify-hosted checkout. Traditionally, a checkout URL might look something like {shop}.myshopify.com/123456/checkouts…
.
To make sure your Hydrogen site works correctly, assign a subdomain for your storefront to checkout. For example, if your Hydrogen store is example.com
, then assign checkout.example.com
to checkout. To do this:
Set the Target to Online Store.
Set the Domain type to Primary.
Configure routing
Anchor link to section titled "Configure routing"When you're migrating from Themes to Headless, you can define your own routes. For example, you might set the route that your cart is on at example.com/bag
instead of example.com/cart
.
To make sure that backlinks continue to work correctly, make sure you set up redirects for any customized routes.
The following is an example of setting up a redirect from /cart
:
Online store redirects and canonical links
Anchor link to section titled "Online store redirects and canonical links"To make sure any backlinks, such as from integrations, send traffic to your Hydrogen storefront and not your Liquid-based Online Store, be sure to set up redirects to take customers to your Hydrogen storefront.
For more information, refer to our redirect traffic doc.
Product feeds
Anchor link to section titled "Product feeds"If you use Shopify's out-of-the-box product feeds, then you'll need to set up feed rules (for example, Facebook and Google) to use your Hydrogen storefront's domain.
Password protection
Anchor link to section titled "Password protection"Online store password protection prevents Hydrogen checkouts. To remove password protection, do the following:
From the Shopify admin, under Sales channels, click Online Store > Preferences.
In the Restrict store access section, deselect Restrict access to visitors with the password.
Click Save.
Notifications
Anchor link to section titled "Notifications"You can update notifications to use the same domain as your Hydrogen storefront.
From the Shopify admin, click Settings > Notifications.
Update the Notification URLs setting.
- Go live with Hydrogen for merchants ready to publish their new Hydrogen storefront.