You can easily backup WhatsApp messages and attachments from your iOS device to computer with Dr.Fone for iOS. Once the data is lost, you can restore them at any time. What's more, the WhatsApp messages, photos and others can be transferred freely between iPhone and Android phones.

To avoid losing Whatsapp messages from iPhone, you'd better backup your iPhone with iTunes or iCloud. This way will backup your Whatsapp messages on your iPhone easily. However, if you backup your iPhone, you backup all the data on your iPhone. When you restore iPhone with the backup file, all the new data on your iPhone will be wiped at the same time. So if you can separately backup your Whatsapp chats on iPhone, it's the best way to solve this problem. I know iPhone Whatsapp Recovery software can do this for you. It can backup your Whatsapp messages on iPhone and restore them when you need. You can learn how to backup and restore Whatsapp messages on iPhone here.