Yes, you can switch between astra and divi themes without losing your website content by using a wordpress migration plugin like all-in-one wp migration.