How do you redesign a website without losing search rankings?
Before development, map every URL, set up 301 redirects from changed ones to pages with the same meaning, and carry over texts, headings, descriptions and structured data. Build the new version on a closed staging site, and on launch day remove the indexing block and check redirects, the sitemap and forms.
More in the guide to website redesign.