I tried to convert a shapefile to a GPX file in QGIS, and I do not know how to keep the ids (attributes). What is the solution?
Waypoints in GPX can have a 'name' (appears in the xml between 'name' tags). Specification for relevant part of the xml is here.
They don't have an 'id'.
The background to this is that for standard GIS data you can give data fields any name you choose, but GPX is very specific about the data attributes.
I don't do this for waypoints, but I'm assuming the same system will work as I use for tracks... which is that I ensure before export that my data table has only one field, called 'name'. This is exported into the GPX file in the appropriate way.
There are more complex things you can do with GPX files using the extension tag but I tend to think that's asking for trouble (the point about GPX being it's standardisation and suitability for a very specific purpose).