Rails are produced in continuous production lines and most of the equipment in this line are huge. Thus, preventive maintenance in these lines is performed by replacing the parts. Since the part replacement in this kind of production lines halts production, it decreases production outputs. An effective scheduling reduces the downtime to the lowest possible levels. In this study, we propose a replacement scheduling model for a rail production line. The replacement scheduling problem is discussed for 1349 parts annually. The problem was studied for the first time in the literature both in size and in the way, it was handled. A new model is proposed integrating Bin Packing solution method into the replacement scheduling problem assuming the replacements as an item. Bottom Left (BL) Bin Packing algorithm is used to assign the replacements in two solution methods. Firstly, the classical Time-Based Replacement (TBR) method was analysed and the downtime was calculated. Secondly, the Flexible Time-Based Replacement (FTBR) method was developed integrating Artificial Bee Colony (ABC) algorithm. When the results are examined for both solutions, FTBR provided a decrease of approximately 12% in downtime compared to TBR. This improvement means 21 328 tons of rail production. As a result, the proposed solution method can be easily applied for any replacement scheduling problem. (C) 2019 Karabuk University. Publishing services by Elsevier B.V.